Certainly I’ve been known to wonder. Jan Swafford explains in Slate that it has to do with the odd fact that musical scales don’t quite ad up right:
So far, all very tidy. But this is where things get hilarious. As Pythagoras also realized in mathematical terms, if you start with a C at the bottom of a piano keyboard and tune a series of 12 perfect 3:2 fifths up to the top, you discover that where you expect to have returned to a perfect high C, that C is overshot, intolerably out of tune. In other words, nature’s math doesn’t add up. A series of perfect intervals doesn’t end at a perfect interval from where you started. If you tune three perfect 5:4 major thirds, it should logically add up to an octave, but it doesn’t; the result is egregiously flat. It is this innate irreconcilability of pitch that, through the centuries, has driven men mad. Professor Duffin is a living representative of a long line of obsessives. Personal and institutional battles have been fought over the issue of tuning, fame won and lost. It was ever thus, wrestling with the gods.
What all this means in practice is that in tuning keyboards and fretted instruments, you have to screw around with the intervals in order to fit the necessary notes into an octave. In other words, as we say, you have to temper pure intervals, nudge them up or down a hair in some systematic way. Otherwise, you get chaos. So there’s the second word you need to remember: The business of adapting tuning to nature’s messy math is called temperament. And now we’re halfway to understanding The Well-Tempered Clavier: It has to do with the art and science of keyboard tuning. We’ll get to the wellness in a minute.
Much more at the link. I’m totally ignorant of the formal aspects of music, so I found the whole thing fascinating. In other clavier blogging, I like Wallace Stevens’ “Peter Quince at the Clavier”.