The solar energy technology is converting the sunlight to electricity. The technical term is Photovoltaic: It consists of the words "photo" for light and "voltaic" representing the electrical voltage. The short versions is PV but it is usually referred as Solar Energy.
In photovoltaic (solar energy, solar energy) technology, the photons coming from the sun take place. Photons are particles coming from the sun to earth carrying light and bearing energy. The photons create an electrical voltage as they hit surfaces containing the parts called solar energy cells in the solar panels. Thus, electricity gets created. The solar cells are produced from silicon, which is actually in the earth and which is used in the production of elements building electronic circuits. Silicon (silisium), which is the element that exists the most right after oxygen on our planet, is a semiconductor. During the production of photovoltaic cells, two layers named p-type and n-type silicon.
As the photons coming from the sun hit the solar cell, they make the energy of the electrons in the p-type silicon layer rise and make them rise to the next energy level, thus, the electrons reach an energy level, in which they can pass through a semiconducting material. In this case the electrons in the p-type silicon layer pass through the semiconducting material and reach the n-type silicon layer. So they create spaces in the p-type silicon layer. As a conducting material gets connected between the two layers, the electrons want to get to the p-type layer because of the created spaces, and electrons flow from the n-type layer to the p-type layer. This flow continues as long as the photons coming from the sun hit the cell and thus we get electrical energy. When the connection between n-type and p-type gets connected to the network through electronic installations (when a solar energy system is created), the gained energy in the network can then be used as electricity.
There are two structures of Solar Energy Systems. Those are OnGrid(network connected) and OffGrid(without network connection or with battery) systems. While the overproduced electricity in the OnGrid systems can be transferred to the network, the OffGrid systems don't have a network connection and batteries are used for energy storage.
In OnGrid systems, the DC (direct current) created by the solar modules gets converted to AC (alternating current) with inverters, it is connected to the electricity grid via the electrical cables of the building. Electricity produced with the these systems intalled on the buildings passes through the network of the building first, and after giving the needed energy there, the surplus is automatically given to the city network. In case the generated energy is not enough for the needs of the building, the needed rest is taken from the city network automatically.
Big size solar energy systems installed to meet the electric demand of cities (Solar Power Plants) are OnGrid-built.
In the OffGrid solar energy systems, the electricity produced by the solar panels gets through charge regulators and be stored in batteries. The direct current taken from the battery gets converted to alternative current with installations called invertors and given to the building network. The energy surplus in the OffGrid solar energy systems won't be given to the network. If the batteries are full, the electricity production with the solar panels continues and there's no consumption, the solar energy system shuts itself down automatically. In cases the solar energy system produces no electricity (night time), and the batteries are empty but there's need for electric consumption in the buiding, the needed electricity will be automatically drawn from the electric network of the city.