When subjected to the sun, the PV cells of a solar panel absorb the energy from the sun's beams. This energy transforms into moving electrical charges in response to an internal electric field within the cell, which allows electricity to flow.