How does solar work?

Solar panels absorb energy from the sun by way of a semiconductor (typically silicon) and generate a direct current electrical source. An inverter is used to convert the source to an alternating current source.