Solar cell converts radiant energy of the sun into electric energy through photovoltaic effect.
When strong light enters the p-n junction of a semiconductor or the border between metals with rectifying actions and semiconductors, elctron and electron hole inside the semiconductor are separated as results of contact potential difference to generate different electricity in both materials.