The story of how the formula became an established "fact" is amusing.
"In preparation for a medical meeting , Dr. Haskell culled data from about 10 published studies in which people of different ages had been tested to find their maximum heart rates.
The subjects were never meant to be a representative sample of the population, said Dr. Haskell, who is now a professor of medicine at Stanford. Most were under 55 and some were smokers or had heart disease.
On an airplane traveling to the meeting, Dr. Haskell pulled out his data and showed them to Dr. Fox. ''We drew a line through the points and I said, 'Gee, if you extrapolate that out it looks like at age 20, the heart rate maximum is 200 and at age 40 it's 180 and at age 60 it's 160,'' Dr. Haskell said.
At that point, Dr. Fox suggested a formula: maximum heart rate equals 220 minus age."
From
https://www.nytimes.com/2001/04/24/health/maximum-heart-rate-theory-is-challenged.html