Because water is a whole lot more dens than air.
The computer of course has a built in sensitive altimeter
It doesn't have to be very sensitive, because water is a whole lot more dense than air. Bit of low air pressure is unlikely going to damage a bit of kit designed to withstand many times the sea level pressure.
(non-diver speaking here, just applying a bit of engineering logic)