Tube lights (fluorescent lights?) and fans usually don't need a sine-wave. A simple square-wave circuit is much easier to make than a sine-wave circuit.
An inverter generates fairly high voltage AC from a battery.
A UPS charges its battery, generates AC the same as an inverter and either runs all the time or switches itself on very quickly so its load isn't affected when the mains fails.