How does solar energy work? When the sun shines onto a solar panel, PV cells in the panel absorb the sunlight, creating electrical charges that move in response to an internal electrical field in the cell. This causes electricity to flow through whatever the solar panels are connected to.