A solar cell operates based on the photovoltaic effect, which is enabled by a p-n junction in a semiconductor material.