PV takes advantage of the characteristics of impure silicon crystals. Pure silicon is not electrically active, because its atoms are locked into a solid crystal structure. There are no spare electrons, and no open spots for electrons. Silicon impurities create crystal with either a slight tendency to lose electrons or a slight tendency to attract them. When the two kinds of silicon are placed close together and exposed to sunlight, photons (particles of light) knock electrons loose on the unattractive side. An electrical current is created as electrons travel across the junction to the attractive side.
Sunlight is composed of particles of energy called photons. When sunlight strikes a PV material, photons will either pass through, be reflected, or be absorbed. If the photon is absorbed, its energy will be transferred to an electron in an atom of the PV material. With new energy, the electron is able to escape from its normal position in orbit around that atom. In this way, the electron can become part of, and augment, the current in an electrical circuit. This photovoltaic effect is the basic physical process through which sunlight is converted into electricity.
Light-emitting diodes (LEDs) are made of similar materials and take advantage of the same physical principles, but in reverse. Powering LEDs with a PV panel works compatibly: photons in, electrons out; electrons in, photons out.