What happens to excess electricity generated going in to a grid?
A good question. The excess of generator drive power over generator load will cause all of the generators on the grid to start speeding up.
For a small over-power, there will be time for the mechanical steam valves and water valves to start closing, and reducing power to the generators, which will slow them back to nominal speed.
For a large over-power event, let's say there's a generating station at the end of a long feeder, and the feeder opens for some reason, then a set of large (very large) resistors will be switched onto the station as a safety load, until the power input to the generators can be throttled down.
A few years ago, I read the report of a test of such a bank of resistors, where the old cast-iron ones (which absorb the energy by heating up) were replaced by sheet stainless steel ones (which were much less massive and had to dissipate the power to the air). I'll see if I can find it again and link to it. The test went on for 30 seconds, which sounded like the length of time they expected could pass before they shut down the steam input to the turbines.