Solar Panels collect DC energy from the sun's rays. The inverter changes the DC current into an AC current that powers your home. The excess electricity is sent to your utility company through the grid tied connection. If you produce more than you use, then you only pay your utility companies connection fee, and you have achieved Net Zero through Net Metering.
I like to compare Net Metering to a bank account. When a consultation is done correctly, a 12 month electric average will be used. Some months you will produce more energy than you use. That energy is stored with your electric provider. The months you use more than you produce, that energy is given back to you at the same price that the electric company charges you. When a proper calculation is done then you only pay your electric provider a grid tied connection fee which ranges in between $10 to $16 a month here in Central Florida. If you have a Smart Meter then your home is already solar ready. If you don't then then the electric company will replace it, so them as well as yourself can track and monitor what you are putting into the grid. That is what we call a Net Zero system.
Solar does not work after the sun goes down, or during a power outage. When the sun goes down you are able to get electric back at the same price from the electric company through net metering. In an emergency power outage situation panels shut down, and quit powering your home. This is Federal Law and this is to prevent back feed from going back into the grid, and potentially injuring or killing a line worker. One way to bypass that situation to have power during emergency situations is through battery storage. When the power goes out, the battery continues to power the home.