How do solar panels create energy?

Solar panels convert the radiant energy from sunlight into electric energy in the form of direct current electricity.