In most cases the UPS simply absorbs the errant condition and all of your protected equipment continues functioning normally. However, in the case of a complete power outage, the UPS will immediately switch over to backup mode and continue providing power to all the devices connected to it.
This gives you time to assess the situation. Is it a temporary outage? Or is the outage mysterious and unexpected? If you don't know to a reasonable certainty that the power will come right back on, your next action is to begin a controlled shutdown of all your UPS-protected equipment. For computers and servers this means saving all open files and databases, exiting all open applications, and shutting down the computer. You can then power off the devices and know that your data is safe.
The more advanced UPS models can even be integrated into the operation of your computer by connecting them with a communications cable. If no one is around to effect a controlled shutdown, when the UPS is about to run out of power it can initiate an automated shutdown of the attached computer so that the whole system does not crash. Some of your applications may be interrupted as a result, but this type of shutdown is better than wondering if your computer lost data or if hardware was damaged or destroyed when the power failed and you didn't have a UPS.