Here is a quick summary of how solar panels work.
A solar panel is a packaged, connected assembly of photovoltaic cells. These cells are an electrical device that converts the energy of light directly into electricity. The cells are then grouped together into modules and packaged into a frame, which then becomes a solar panel.
Photovoltaic cells are made up of semiconductors, usually silicon, and when light strikes the cell, a certain portion is absorbed. This energy is then transferred to the semiconductor, knocking the electrons loose for them to flow freely. The cells also have electric fields to force the electrons to flow in a particular direction. Finally the cells have metal conductors on the top and the bottom which therefore draws the current of the electrons flowing to be used externally.
The cells must be connected electrically to one another and to the rest of the system, and also need to be protected from mechanical damage and moisture. The most common type of panels are crystalline silicon modules, however there have also been recent developments with rigid and flexible thin film modules.
The solar panel can be used as a component of a larger photovoltaic system to generate and supply electricity, as a singular solar panel can only produce a limited amount of power. This then forms your typical solar power system at home.