The shape of our earth is not perfectly spherical. So when we try to approximate the shape of it, we have to find an appropriate model. In the past, we've learned that an appropriate model can be an ellipsoid. However, the geoid is a more advanced reference surface that is now often used to approximate the shape of the Earth and to measure elevations (see orthometric elevation).
Any point on the geoid is subject to the same level of gravity and the earth's geoid is set at the mean sea level.
To compare the difference between geoid and ellipsoid. The deviation between the Geoid and a reference ellipsoid is called geoid separation (N) (see figure below).