Without automated phase frequency control and global frequency clocks with an error of < 0.0001 ppm for reference, the grid would slow down in frequency with loading effects on generators and rise in frequency with lower demand. Every generator has some means to control Voltage and Frequency independently with parameters monitored locally but references from the remote interconnect site. Also phase as well, is critical, which is the time integration of frequency error.
The simple way to understand this is the output impedance of the grid is much lower than the demand load impedance such that load changes do not affect the grid voltage too much. This impedance ratio is the same as the regional step load voltage regulation error. Parameters are often measured in "per unit" or p.u. of the nominal values.
Unfortunately in some countries with a loose grid, consumers try to do their own regulation with voltage auto tap changers which then causes more load current to boost voltage and in effect causes a positive feedback loop to the generator making their grid unstable. This can only be improved slowly with bigger transformers and more supply sources to shunt and lower the grid impedance while not exceeding thenratio for short circuit current in any one transformer. The bigger xxx MV transformers must also have a higher Zo of 8 to 10% due to the extreme internal forces limitations, so it is not a simple solution but a steady infrastructure growth to improve power quality.
Thus since the grid is intelligently controlled , every minute an algorithm is computed at an interconnect point and new parameters for each generator are fed back to ensure supply meets demand at the lowest cost with phase/frequency/voltage feedback to each source at connection points.
This in turn affects the power stored on the grid to meet surge demands. It affects RMS voltage, frequency and phase at the end user by many complex interconnected control systems with a regional centralized reference managed by a government regulators group that dictates to all roviders and delivers to all customers, the measureable power standards established in the Industry for each region.
A loose grid in one region might vary 5% in frequency with insufficient redundancy, while a very tight grid might be < 0.0001 PPM, some of the time but vary much more then have a low mean frequency error over a daily cycle. The cost of stability is greater and its tolerance allows more short term cost reduced flexibility but may cost more in maintenance from surges, so changes are made very slowly. Each source may have different rate structures and capacity.
You can read about "some" of the simpler algorithms here.
Where I live in Ontario, Canada , Hydro One owns and operates around 30,000 circuit km of high voltage lines: 115kV, 230kV & 500kV within 5% ( with <1% due to source variation and 4% from load variation) and 123,000 circuit km of low voltage <=50kV within another 5% ( which includes load variations and line drop ) and thus the subscriber enjoys a voltage tolerance of 10% max but is typically within 2% in many residential areas.
Power glitches are very infrequent as well as fault shutdowns are normally very brief annually perhaps a few times a year in one given area. This high quality service level is due to high redundancy and good condition based maintenance (CBM) rather than just time based maintenance or fault fixing. But then we still complain about rising prices and plans to privatize it short short term political financial gain and long term cost increases to users.
This is accomplished through a complex network of load-balance , rate-structures contract pricing for 27 interconnections with 2 other Provinces and 3 States in the US. The regulation of source and balance supply and demand for the best price. Since Nuclear loads must be 100% as it is not an adjustable source, guaranteed pricing and delivery.
Generation is controlled by voltage and phase to the grid and by automated tap changes for each transformer station with communication between the stations to anticipate changes.