Jet Jockey...
It's not quite like that, in Europe at least; they are (usually) on mains power, but with a "no-break" stand-by.
The stand-by can be an alternative source of mains power (obviously coming from a completely independent distribution) or a diesel or turbine-driven generator that is kept spinning 24/7.
The standby cuts in as soon as a loss of power is sensed; I don't remember the so-called no-break period allowed but it is a very few seconds, such that a landing aircraft is not seriously discommoded. If in the last 50 -100 ft or so, it is "hoped" that the landing lights will help complete a safe touch-down before AGL is restored, if the aircraft is committed. A GA may be an option if not.
The stand-by will normally power the AGL, radars (approach at least), navigation and comms, essential ramp lighting, emergency systems and safety lighting in terminals etc.
There's no law that I know of that says it must be mains supply backed by local generator rather then the other way round, but the bean-counters would have a strong view on the cost of running full-time on a private generator. The spinning generator requires very little power unless and until it takes the load.
PS A quick reminder look at
ICAO Annexe 14 Chapter 8.1 tells us that for Cat II/III the switch-over time, to use ICAO terminology, is 1 second for the really essential AGL, eg runway centre line, TDZ, end lighting etc, and 15 seconds for the rest. It's a rivetting read.