I used to work on Air Traffic Control software and the first interesting thing I learned was this.
Airplanes usually don't know how high up they actually are. It's an estimation based on a standardized air pressure measurement.
But this gives correct difference between your altitude and other planes in the area, which is the important bit.