Despite most people thinking that an altimeter measures altitude, it is more true to say that it measures the difference between the atmospheric pressure at a benchmark level (sea level, in most cases) and the level at which the altimeter is located.
This is done by placing the altimeter in a location where the altitude is known for certain. The hiking panels and elevation points provided on ordnance survey maps are very useful.
During a hike, in addition to the drop in atmospheric pressure as you ascend to a higher altitude or the increase in pressure experienced when descending, the altimeter registers the changes in atmospheric pressure caused by changes in the weather. Consequently, the altimeter can indicate an inaccurate altitude because of the changes in the weather (higher than the actual location, if the atmospheric pressure drops with the arrival of a depression and vice versa).
This is why the altimeter must regularly be calibrated during a hike at known altitudes.