With pianos there are actually two things going on. They're tuned approximately to 12-tone equal temperament, but also the octave is stretched due to the inharmonicity inherent in the strings. (In the middle-range the strings are pretty well behaved, but in the high treble they start acting more like metal cylinders than ideal strings, and the bass has wound and double wound strings to similarly mess things up. The result is that the harmonics of piano strings aren't exactly multiples of the fundamental frequency, and so the tuning is stretched so that harmonics of lower notes more closely match the fundamentals of higher notes.)
https://en.wikipedia.org/wiki/Piano_acoustics#The_Railsback_...