What makes it a power grid is that the stations and substations are connected in a mesh topology. Every major load center is going to have multiple possible paths for power flows from multiple generators. In most cities, even residential distribution will have multiple feeder paths.
In most cases these are controlled by switches at the substations that put circuits in and out of service, thus moving the path current must take. More modern options include phase shifting transformers and other reactive device, and even impedance reactors that will adjust flow across multiple live circuits.
Aside from that, changing where generation is happening also moves current to different circuit paths, so for example a "peaker" gas turbine plant that can ramp up quickly might be brought online in one location electrically closer to the load to balance flow away from an overloaded or to-be-disconnect circuit.
What that practically means is power that would have normally come through those substation would be delivered by some other source, and thus go through a different set of substations.
What most people don't understand is that it's important that the demand + the transmission losses = the production, not just as a whole, but also for each link. To help with that most places don't produce 100%, and a lot of higher power links are redundant. But that can only cover so much. If it's not a high demand day you can probably source power from other providers, but sometimes that's not enough.
EIL5 Answer. Power (mostly) follows the path of least resistance. Like water does.
To divert power certain stations or links in the grid can offer resistance via either terminating, or other means.
Another thing is, It’s a common understanding that power facilities can produce and modulate power. But they can also spin in reverse, thus using power.