Solar panels work by allowing photons, or particles of light, to knock electrons free from atoms, generating a flow of electricity. Solar panels actually comprise many smaller units called photovoltaic cells. Photovoltaic cells convert sunlight into electrical energy.