While solar panels are most efficient in direct sunlight, they can still generate electricity on cloudy days. However, the amount of electricity generated will be less than on sunny days. This is why it is important to have a battery backup system in place to ensure a steady supply of power.