Today might be a rainy day on my side of the world, but despite the weather we must continue to look towards sunnier days. Because the fact is that the Earth intercepts a whole lot of sunlight - 173,000,000,000,000,000 watts to be exact - and it's a shame not to take advantage of all this potential energy, especially with our growing climate crisis due to our reliance on fossil fuels. And not to mention that all that potential energy actually accounts for 10,000 times more power than the entire planet's population uses! So how to we capture all that energy? Let's take a look at how solar panels work.
Solar panels are made up of solar cells, most of which are made of the semi-conductor, silicone. This silicone is layered between conductive materials. Because silicone is 4-way bonded to each other, no electrons can move, hence no energy can flow. Two types of silicone are used in a solar cell: N type, which has extra electrons, and P type, which has extra spaces for electrons. The junctions of P-N silicone form a negative-positive charge. This is crucial for when a photon from the sun reaches the solar cell.
When a photon with enough energy arrives to the solar cell, it will knock an electron from its bond, leaving a hole. The electron will be drawn to the N side while the hole is drawn to the P side. The electron will be collected by thin metal at the top of the solar cell that can power, let's say, a light bulb. In this way, electrons are the only moving parts in a solar cell. While each solar cell is only capable of producing half a volt of energy like this, attaching solar cells together (to form solar panels) can produce a greater amount of energy.