Once your solar panels are generating more electricity than your home needs, you have a choice. If you have a home battery, you can store that spare electricity and use it later. Or you can export it to the grid and get paid for the energy you send back.
There is no single answer that will be right for every home. Whether storing or exporting makes more financial sense depends on what your electricity supplier pays you for exported power, what you would otherwise pay to buy electricity later, and when your household tends to use energy.