How do solar panels work?

Solar panels collect energy from the sun and convert this to DC electricity.