This is a classical example of control system with a PID, regulating the water level to reach the consigne level.

water_tank

More:

https://en.wikipedia.org/wiki/PID_controller