It sounds like a basic requirement: an instrument should just be in tune. It turns out that's mathematically impossible for a fixed keyboard that needs to play in every key — not a manufacturing shortfall, but an actual conflict between two different kinds of "pure." Equal temperament, the tuning system behind essentially every piano built in the last two centuries, doesn't solve that conflict. It spreads it out evenly enough that no single interval sounds broken.
The problem: pure intervals don't close the loop
A pure, mathematically exact musical fifth has a frequency ratio of 3:2 between its two notes. Stack twelve of those pure fifths in a row, moving up through the circle of fifths, and you should land back on the same pitch class you started from, seven octaves higher — because twelve fifths and seven octaves cover roughly the same musical distance. They don't cover exactly the same distance. Raise the fraction 3/2 to the twelfth power and it doesn't equal 2 raised to the seventh power; it comes out slightly higher. That small but very real mismatch is called the Pythagorean comma. Tune every fifth on a keyboard perfectly pure, and the twelfth one — the interval that's supposed to close the loop back to the start — comes out audibly, unpleasantly out of tune, an effect old tuners called the "wolf" interval for the way it snarls.
Equal temperament's fix: spread the error evenly so no one hears it
Equal temperament resolves this by giving up on any interval besides the octave being perfectly pure. It divides the octave into twelve identical semitones, each one exactly the twelfth root of two times the frequency below it, so every fifth, every third, and every other interval is detuned from its mathematically pure version by the same small, evenly distributed amount. No interval is perfect. No interval is unusably bad either — and because every semitone step is now mathematically identical, the same pattern of fingering and intervals sounds the same starting from any of the twelve keys, letting a single fixed-pitch keyboard modulate freely between them, something the older tuning systems it replaced couldn't manage cleanly. Bach's 1722 collection The Well-Tempered Clavier is often invoked here, though it most likely used one of several unequal "well temperaments" — tunings that made every key usable without making them all identical — rather than strict equal temperament, which took longer to become standard keyboard practice than the title suggests.
What we're still unsure about
The compromise is audible if you know what to listen for, and it isn't distributed evenly across every interval type: equal temperament's major thirds, in particular, are measurably further from pure than its fifths are. That's exactly why unfretted string players, singers, and some non-Western musical traditions still favour just intonation or other tunings in contexts where they can adjust pitch freely rather than being locked to fixed keys — and why musicians and instrument builders still genuinely disagree about how much that lost purity matters against the flexibility equal temperament buys. It's a design trade-off each musical tradition keeps weighing differently, not a problem anyone has definitively closed.
This sits inside Scales, Keys & Modes, one of eight topics in Music Theory, one of four domains in Music, one of seventeen subjects the app can quiz you on.