While all the replies are informative and correct, I don't think they have answered the original question:
"How does the pressure once reset on the altimeter automatically change the altitude?"
The barometric (pressure setting) knob has a direct mechanical connection to:
1. the subscale, or barometric setting; and
2. the altimeter pointers (or counter drum).
This means that when you turn the barometric knob in an 'increase' direction, two things happen simultaneously:
1. the subscale shows an increase in the barometric setting; and
2. the altimeter pointers (or counter drum) show an increase in the indicated altitude, at the rate of approximately 30ft per hPa of barometric pressure (or 10ft per .01 in Hg)
The similar but opposite actions occur if the knob is turned in a 'decrease' direction.
Note that the aneroid capsules which expand or contract with decrease/increase in static air pressure do not change their size during this process. In other words, the movement of the altimeter pointers or counter drum is achieved without expansion or contraction of the aneroid capsules.