How does Solar Work?
Each solar panel is has several individual photovoltaic cells consisting of semiconducting material.
When the sunlight hits this material, the energy is absorbed and flows out of the cells. This is called Direct Current electricity.
Next, the DC electricity flows to an inverter, where it is converted into Alternating Current.
Once DC is converted into AC, it is ready for your building to use. It then flows from the inverter into your structure's power system.
Your home or business may use this power the same way electricity from the grid is used. Furthermore, any excess energy flows out to your utility company. In turn, your energy company may give you a credit on your electric bill.
This video makes it simple
To give you an even better idea, here's a video from the Solar division of the Energy.gov website.