We've used the Sun for drying clothes and food for thousands of years, but only recently have we been able to use it for generating power. The Sun is 150 million kilometres away, and amazingly powerful. Just the tiny fraction of the Sun's energy that hits the Earth (around a hundredth of a millionth of a percent) is enough to meet all our power needs many times over.
In fact, every minute, enough energy arrives at the Earth to meet our demands for a whole year - if only we could harness it properly.
Solar panels collect solar radiation from the sun and actively convert that energy to electricity. Solar panels are comprised of several individual solar cells. These solar cells function similarly to large semiconductors and utilize a large-area p-n junction diode. When the solar cells are exposed to sunlight, the p-n junction diodes convert the energy from sunlight into usable electrical energy. The energy generated from photons striking the surface of the solar panel allows electrons to be knocked out of their orbits and released, and electric fields in the solar cells pull these free electrons in a directional current, from which metal contacts in the solar cell can generate electricity.
The more solar cells in a solar panel and the higher the quality of the solar cells, the more total electrical output the solar panel can produce.