There are these mysterious items that store energy for use later. Assaults? No, something close though.
I think there are a few ways. Here, they’re building “pumped storage” where they pump water up to a high lake when power is cheap, then drop it back to the low lake via turbines to make electricity when power is in demand.
Buy low, sell high.