How can solar panels generate energy?

Answer: 
According to Prosolar International, solar panels collect electrical charges from sunlight. This collected energy is then converted to usable power by an inverter. Solar panels are typically mounted on roofs to maximize light exposure.
Question: 
How can solar panels generate energy?