The sensor measures the pressure of the water above it. The higher the pressure, the higher the water level. The sensor calculates the height of the water level based on this pressure.
Pressure = Water Height
The sensor uses this equation to determine how much pressure is driving the water to the surface, and thus calculates the natural rise of water above the sensor level.