On Earth, the height of the relief is measured in relation to the level of the sea. But how do we do for the planets and the moons which do not have oceans? How to measure the altitude of the mountains and the depth of the craters on waterless worlds billions and trillions of miles away? It is necessary to establish a reference surface.
For starters, we can simply measure mountains from their base. Otherwise, a first possibility for establishing a reference level is to imagine that the planet in question has oceans of liquid water and to determine the fictitious sea level in this case. This method was used to measure the altitude on Mars until 2001.
Thus, the zero level elevation corresponded by convention to the points for which the atmospheric pressure is equal to 610.5 Pa. This isobar is the triple point of the water on Mars, that is to say that below this pressure limit, liquid water, so an ocean, has no chance to exist on the red planet. However, this method proved to be too imprecise and has been replaced.
The other, much better, possibility is to approximate the surface of the planet by a model. For example, for the Earth, one can use as a reference an ellipsoid or a geoid. The latter is more precise than the ellipsoid and is defined as the equipotential surface of the gravitational field. It is deformed by the uneven distribution of the masses inside the Earth (more or less dense areas of the mantle) and on the surface (mountains, hollows). It corresponds to the average level of the oceans if they were only subject to the gravity and the rotation of the Earth.
Since 2001, the equivalent of the geoid serves as a new convention on Mars: the Martian zero level is thus defined by the equipotential surface of the gravitational field. It was determined thanks to the data acquired by the onboard laser altimeter on the Mars Global Surveyor probe (1997-2006). Its average value at the equator is equal to the average radius of the planet, or 3.396 km from the center of the planet.
On Venus and on the Moon, the reference zero level is simply the average radius, because these celestial bodies are spherical enough to be approximated by a sphere.