Basically a sump works by a combination of gravity and a pump. In an under tank sump gravity remove the water from the main tank and the pump in the sump returns it to the tank. An overhead sump works the other way. You need a pump in the tank to get the water up into the sump and then gravity is what returns it to the tank.
There are several ways to make the system more fail safe to prevent flooding. This normally involves some form of float valve. This works like your toilet when flushed. The refill water is turned on and off by that floating ball in the water tank part of the toilet. The float valve in a sump system is used to turn off the pump at a given level. And instead of being entirely mechanical only like your toilet, a float valve can control and on/off switch for the power to the pump.
The float valve can work in either direction. That is, it can be used to turn on or off if the water rises to a specified level or if it drops below a certain level.
The way a sump works to protect one from flooding during a power loss has to do with the overflow part of the system that runs on gravity. Basically water is able to flow into, thru and out of the overflow as long as the water level is higher than the overflow intake. If the water drops below this level, the flow stops. Think of it like you do a siphon used for a water change, if the intake of the siphon is fixed two inches below the surface of the water, when the water has dropped two inches, the flow stops because the siphon is broken.
It is the combination of the float valve on the pump and the level at which one sets the intake of the overflow part which prevents flooding.
Here is a vid on how to build a DIY overhead sump
http/www.youtube.com/watch?v=YFcioRUCa6c