Why are pianos traditionally tuned “out of tune” at the extremes?

Why are pianos traditionally tuned “out of tune” at the extremes?

For example, the string of a middle A in the piano can vibrate at 440Hz, 880Hz = 2*440Hz, 1320Hz = 3*440Hz, 1760Hz, … When you hit the string with the hammer, the string typically vibrates with a combination of several of these frequencies. In the middle range of the piano, its strings can pretty accurately be considered perfect and partials tend to be true harmonics. To avoid this, the low A is tuned flat, let’s say at 52Hz, with partials (still fictional) at 110Hz, 167Hz, … Now when you play the low A alone? Same with the high range on the piano: the very thin, highly constrained strings are far from an ideal string; their partials also are not true harmonics.

Source: music.stackexchange.com