A grid-connected solar PV system is an array of solar panels connected to the electricity grid via an approved grid feed inverter to offset the power usage of your home. Your appliances in the home have the first call on the solar power produced by your system. If extra power is being generated by the system, the surplus is fed back into the electricity grid via a meter that can register energy flow in both directions.
At night, when the solar modules are not producing electricity, the electricity comes to you from the grid. If you export enough energy during the day, it can balance or exceed the amount you draw from the grid at night.
At the end of your billing period your electricity supplier works out how much energy you have produced and how much you have used. You only pay for the energy you use that is in excess of what you produce. If you produce more electricity than you use you will be in credit.