Size a backup generator or UPS to your connected load, with the right safety margin for motor starting surges.
kVA (apparent power) is what generators are rated in — it's always higher than the kW (real power) figure once power factor and starting-surge margin are included. Motors, pumps and AC compressors draw several times their running current for an instant on startup, which is why they need a bigger margin.
Generators and UPS units are rated in kVA (apparent power) because that's what their alternator/inverter has to physically handle, including the reactive power drawn by motors and compressors — kW (real power) alone understates what the machine needs to supply.
A motor, compressor or pump can draw 3–7× its running current for a fraction of a second at startup. Sizing the generator only to the steady-state running load risks it stalling or tripping every time a heavy appliance switches on — the safety margin (20–50% depending on load profile) accounts for this.
A generator supplies power as long as it has fuel, with a brief changeover delay. A UPS/inverter with batteries switches over instantly but only lasts as long as its battery bank. Many homes in Pakistan combine both — see the Solar System Size Calculator for battery-bank sizing.