First of all, UPS stands for Uninterruptible Power Supply. A UPS system serves as a backup power source to your mains or utility AC supply. Actually, the backup power source is the battery. The UPS converts input DC power supply from the battery into output AC power supply to its connected loads.
In practice, the UPS either includes a battery or batteries internally or is connected to an external battery bank.
Left (First): The popular APC BX600C-IN UPS includes an internal battery (source: APC)
Right (Second): Amaron Quanta SMF batteries used as external batteries (source: IndiaMART)
A UPS provides backup power when utility power or mains power fails. The question: for how long? The answer: long enough to allow critical equipment such as computers (or machines on a factory shop floor) to shut down gracefully so that no data or work-in-progress is lost.
You select the internal vs. external batteries option with your UPS depending on your backup time need. Internal batteries go inside the UPS and the limiting space inside limits the total battery capacity. Hence, they are best suited for short backup times. External batteries, on the other hand, are your best option for long backup periods.
The UPS does more than supply backup power. What many don't know is that a UPS also conditions the incoming power from the primary or secondary AC source to protect sensitive electronic gear or loads from the all too common power problems of sags and surges.
Sags and undervoltages in your power supply can cause system halts, loss of data, or shutdowns. Surges or swells and overvoltages can cause nuisance tripping, equipment damage, or reduction of equipment life.
Nuisance Tripping (source: westernautomation.com)