Energy Production Solar panels generate electricity when sunlight strikes the photovoltaic cells, which create a flow of electrons, producing direct current (DC) electricity. This DC electricity is then converted into alternating current (AC) electricity by the inverter, which can power household appliances and feed excess electricity back into the grid if the system is grid-tied.