How do solar panels generate electricity?
Solar panels generate electricity by converting sunlight into electrical energy through the photovoltaic effect. When sunlight hits the solar cells, it excites electrons, creating an electric current which is then used as a power source.