Overflows and sandpipes work because the water flowing out of the tank is in direct proportion to the water flowing into the tank and the water flowing out of the tank is directly dependent on the water flowing into the tank. The first picture shows the flow of water in a normal tank while the power is on.
When the power goes out, the water will stop flowing into the tank. As the water level in the main tank drops, the water level in the sump rises. When the water level in the main tank drops below the level of the overflow, no more water will flow into the sump.
When the power comes back on, the water level in the main tank will raise until it starts to spill into the overflow and eventually into the sump. Once this happens, you have reached steady state and the water flow returns to normal (see the first picture).
A few words of caution; all this depends on the two things. First, the siphon in the overflow is maintained. Use of a sandpipe will mostly eliminate this risk. Finally, the main tank return is not below the overflow’s water level. If it is, water will flow into the sump until the water level in the main tank is below the return.