There are times during the day that your solar panels are making lots of energy, and peak times when you will use more energy. These are not always at the same time of the day!
The battery allows energy to be stored when production is high and then used when it is needed, but production is lower, making the most of the clean energy you generate.