How it works
The taller person's shoulder sits at about 82% of their height. A head below that level can be patted with a relaxed arm; above it, the arm has to lift.
Example
A 185 cm person's shoulder is at about 151 cm. Anyone up to about 141 cm gets an effortless pat; at 160 cm the arm has to rise above the shoulder, which feels like a stretch over time.
Why it varies
Arm length, posture and how close you stand all change the feel. Leaning in a little lowers the hand by several centimetres.