I'd recommend the book The Grid as a primer on how stuff like this can happen. Energy is strange, in the sense that everything produced needs to be used more or less immediately. Maintaining the energy grid is a careful balancing act between preventing surges and blackouts.
There are a lot of grid-related engineering problems that come from increasing decentralization (e.g. wind, solar, hydro) because it increases unpredictability in supply.