Indeed, but cheaper than enough batteries to cover those times
In the off grid home scale one I'd size and set the generator to run for several hours in a row to fully charge the battery on days when the battery was at a sufficiently low charge entering the night, at least that's what my current modelling suggests. Diesel gensets work best when running fully loaded for at least long enough to warm up
I guess at grid scale you find the sweet spot where most years the gas power station and batteries are balanced to provide cheapest power averaged over the year




