system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: how does a country like the USA produce exactly as much electricity as needed at all times. Where does excess power go when not needed?
gpt
One one side, you regulate the output of your powerplants to meet demand. That can be complicated with some plants, so the system is set up that you have base load plants, that will essentially run at constant production, mostly nuclear and coal, and peak load plants, which can react quickly to changing demand, that is mostly gas. 

On another side, you can store excess production. That's done with pumped storage plants. Excess energy is used to pump water into an uphill reservoir, from which it can be quickly released downhill through a water turbine to produce electricity again when the need is there.

Overall, it's a fine balancing game between all the different sources and the changing demand. But the folks running that game have lots of statistical data on how demand changes over time and can predict what they have to do based on that.