The geoid is an equipotential, or level, surface of the earth’s gravity field. Imagine the oceans are allowed to settle under the influence of gravity only and are not subject to tidal or atmospheric forces. Imagine also that tunnels connect the oceans so the water can move freely between them. The resulting surface is a representation of the geoid. The geoid is approximately equal to mean sea level (MSL) and generally differs from local mean sea level by a meter or so. It is a complex shape.
The geoid is influenced by the composition of the earth so it may have discontinuities in its slope. This means that the surface is an analytic surface as opposed to a mathematical surface like an ellipsoid. The geoid generally differs from an earth-centered horizontal geodetic datum by less than 100 meters. For example, in the United Kingdom, the geoid and the horizontal datum (OSGB36) differ by less than 5 meters.
In the illustration above, the green line represents the geoid surface. It roughly curves to follow the topography. The dashed line represents the surface of the spheroid. The h is the height above the spheroid, or ellipsoid (HAE). In this case, the height is a negative value. Geoid undulation, N, is the distance between the spheroid and geoid surface. The orthometric height, H" is related to the spheroid height by the following:
h = H + N