Very similar to a 3d printer's "power panic" or similar feature. In their case, they monitor the mains voltage before the SMPS, so they have some tens of ms worth of reaction time with its capacitors and such - not a large addition of extra ones. That's enough time to store the current place in the gcode (instructions for printing the object) stop the movement of the print head, and store the head location. If you've stopped, there can still be potential slackening when powered off or external forces moving things, but it's a heck of a lot better than being in the middle of a move where you don't know how far you've progressed.