Not every solar power system has a solar battery attached. In fact, only about 4% of residential solar installations had a battery backup in 2020, though the numbers are climbing quickly. Many solar power systems instead send electricity into a home without any on-site solar energy storage. At that point, through a connection to the conventional power grid, the solar power system "sells back" extra energy to the power company. At night, these grid-connected systems just draw on conventional electricity, buying it from the power company.
Adding a battery system allows for two main benefits. First, it gives homeowners the ability to draw on battery power during hours when the power company is selling electricity at a higher rate, called peak hours, if they use "Time of Use" pricing (PDF).
Peak hours are often the weekdays when the most people are home and using electricity, often around 8-10 a.m. and 6-8 p.m. on weekdays. Secondly, a battery backup allows you to avoid interruptions in electricity if the power grid is out or at night.