...or to put it another way
As you go higher, the air pressure drops and the altimeter measures that drop and converts it to height - around 30 feet corresponds to a drop in pressure of one millibar (or one hectopascal - same thing).
If the general atmospheric pressure never changed, that's all we would need. However, the atmospheric pressure goes up and down with the weather. The QNH is used to set the altimeter so that it would be zero at sea level. Once that's set, the altimeter simply shows another 30 feet of height when the air pressure drops by a millibar.
In the UK we often use QFE and set the altimeter to show zero when at airfield level. If the airfield is 60 feet higher than see level then the subscale will show 2mm less than it would if you were setting the QNH.