The air pressure at a given point on the Earth is produced by the weight of the atmosphere above it.. This is why air pressure decreases with altitude. Because an altimeter measures atmospheric pressure and does not measure altitude directly, it is actually a barometer. For the purpose of calculating absolute altitude, the pressure at sea-level is assumed as being zero-point pressure. Atmospheric pressure, however, also depends on the weather and on temperature changes. As a barometer, an altimeter will thus indicate temperature changes, but these then affect the overall accuracy of the altitude being displayed: air pressure fluctuations of 1 mbar will cause a difference in altitude of 8 meters, and changes in weather (as with fronts) can cause air pressure to change by up to 5 mbar (40 meters altitude change!). To eliminate this effect, an altimeter needs continual re-calibration, preferably once every 3 hours or so. Generally, the altimeter must be calibrated using a known altitude, as one located on a topo map being used. If the altimeter altitude corresponds to that indicated on the map, this means the weather is stable. If it is much higher than the known altitude, this means bad weather (a depression) is on the way; if it is lower, better weather is on the way.
Temperature plays a key role as well, and many altimeters feature temperature compensation to avoid erratic pressure readings caused by temperature changes. The problem is, all altimeters assume the temperature of 15 °C at sea level, which decreases by .65 °C for every 100 m increase in elevation. This theoretical atmosphere is most often not the true atmosphere in which you are actually trying to get a reading. We estimate a difference of 4 meters per 1000 m and per °C difference between the true temperature and theoretical temperature. Getting an accurate true temperature reading requires sitting 20-30 minutes in the shade, shielded from wind and away from body heat. Such calibration is not very realistic operation for most hikers, even if the altimeter also features a thermometer.
Things are even more complicated by the fact that the pressure/altitude relationship is not constant at all points on Earth, and the compensation software on a given instrument is often adapted to a certain geographical zone, such as that in which the altimeter is sold (Europe in our case).
Finally, don't confuse the misleading term "resolution" with "accuracy." The resolution refers to the "range resolution," the numbers displayed on the screen, rather than the accuracy of the internal pressure sensor that determines the viability of the instrument. Getting good range resolution doesn't cost all that much, but a very precise internal pressure sensor is quite expensive to make. Many instruments will thus have an accuracy indication of 2% (i.e., 2% error: 40 meters for 2000 meters), but advertise a "resolution" of 2-5 meters.