The geoid is the surface of the sea, continued at mean sea level on land.

In comparison to the WGS84 ellipsoid, which is an exact ellipsoid, the geoid is only “ellipsoid-shaped”. It has various undulations caused by gravitational anomalies of the earth.

The deviations of a digital elevation model from the true reference surface are compensated by a vertical datum. So the geoid is a particular kind of a vertical datum.

The gravitation on earth is not exactly the same. There exist small variations for places on earth which have a bigger landmass or density of the earth’s molten core. Those areas attract the water body of the sea so that the water forms a hill over the anomaly. The geoid describes the height variation of those hills or undulations compared to the WGS84 ellipsoid as shown in the following image:

wikipedia

For example, in Sardinia the geoid is about 50 meter higher than the WGS84 ellipsoid. For that reason you get an altitude of about 50 meters when using a GPS device on one of Sardinia’s beaches, when you would naturally expect 0 meter altitude.