Battery power is always faster then generator power. That is the reason why every data center has battery backup for immediate reaction and generator power for the longtime backup. Normally, the battery size is designed that the minimum time is at least twice as long as to start the generator.
Exactly that has happened with the grid. It is also not related to some contracting. Because the whole grid is connected. So the battery will always kick in, it does not matter where it is located.
Actually synchronizing the grid is tough task. A friend and colleague from my University started in this business after he made his Master Thesis tens of years ago.
By monitoring the frequency of the grid you know if there is too much energy produced (too less load, frequency to high) or vice versa. Everybody basically can do this from home. There are some maker projects and personal projects who do that.