Right, but if you hook that up to a pump that is automated, you have a problem because pumps are dumb. A pump just knows "on/off" so how do you tell it to not toggle constantly and burn itself out?
Say if you have a constant flow coming in, and as soon as the pump detects the level, it turns on. When the level drops, it turns off. It's going to flip back and forth wildly.
So, what you tell the switch via a float mechanism is "If it touches this value, turn on or stay on" and "If it touches this different value, turn off stay off" and the values actually overlap each other. There will be values that are both on and off values. Such as, if it turns on at 4 liters, but turns off at 2 liters, 3 liters can be either an 'on' or 'off' value depending on the last value of the switch itself. It will pass 3 when filling, and pass 3 again when emptying.