When mains electricity supply is within specification, an electrical generator with a mass functions as motor to store kinetic energy in an electro-mechanical flywheel.
When mains electricity supply fails, stored energy in the flywheel is released to drive the electrical generator, which continues to supply power without interruption.