A UPS contains a battery that "kicks in" when the device senses a loss of power from the primary source. If you are using the computer when the UPS notifies you of the power loss, you have time to save any data you are working on and exit gracefully before the secondary power source (the battery) runs out. When all power runs out, any data in your computer's random access memory (RAM) is erased. When power surges occur, a UPS intercepts the surge so that it doesn't damage the computer.
Voltage and frequency independent (VFI) UPS systems are called dual or double conversion because incoming AC is rectified to DC to keep batteries charged and drive the inverter. The inverter re-creates steady AC power to run the IT equipment.