Whenever the sun shines (and even in overcast weather), the solar cells generate electricity. The inverter converts the DC electricity produced by the solar panels into 240V AC electricity, which can then be used by the property/household.
If a grid connect system is producing more power than is being consumed, the surplus is fed into the mains power grid. Some electricity companies will meter the electricity fed into the grid by your system and provide a credit on your bill.
When the solar cells are not producing power, for example at night, your power is supplied by the mains power grid as usual. The energy retailer charges the usual rate for the power used.