Solar panels generate electricity during daylight hours. Any excess electricity that is not used immediately can be stored in a battery. When the solar panels are not generating electricity, the stored energy in the battery can be used to power the home.