Sunlight hits the PV cells and creates DC (direct current) power.
The DC power is then sent to an inverter which converts it into AC (alternating current) power, which is what household appliances use.
When the sun is shining, power from the panels is used to run electrical loads, and any excess power generated from the panels is sent back to the grid. When that happens, the power meter counts outgoing solar kilowatt hours. However, at night, when the sun is down and the panels are not producing energy, the building draws energy from the grid (local power company) and the energy meter counts incoming utility kilowatt hours.
Net metering is a billing mechanism that credits solar energy system owners for the electricity they add to the grid. For example, if a residential customer has a PV system on the home’s rooftop, it may generate more electricity than the home uses during daylight hours. If the home is net-metered, the electricity meter will count outgoing solar kilowatt hours to provide a credit against what electricity is consumed at night or other periods where the home’s electricity use exceeds the system’s output. Customers are only billed for their “net” energy use. On average, only 20-40% of a solar energy system’s output ever goes into the grid. Exported solar electricity serves nearby customers’ loads, and reduces rate-payers’ costs on new utility infrastructure for peak load demands.
In the event of a power outage, the inverter, which is connected to the grid, recognizes the outage and automatically shuts down your system to protect maintenance workers repairing the grid.