When the sun shines onto solar panel, energy from the sunlight is absorbed by the PV cells in the panels. This energy creates electrical charges that move in response to an internal electrical field in the cell, causing electricty flow.