Every note on a modern piano is slightly out of tune, deliberately and by a known amount. Equal temperament divides the octave into twelve identical steps, which makes every key equally usable by making every interval except the octave equally imperfect.
Pure musical intervals are simple frequency ratios: an octave is exactly 2 to 1, a perfect fifth 3 to 2. Stacking twelve pure fifths should return to the starting note seven octaves up, and it does not. Twelve fifths overshoot seven octaves by about a quarter of a semitone, a discrepancy known as the Pythagorean comma.
This is not a measurement error. No power of 3 over 2 equals any power of 2, so the gap cannot be removed by tuning more carefully. Some compromise is required.
Historical temperaments distributed the error unevenly. Meantone tuning made most thirds very pure at the cost of leaving one interval, the wolf fifth, badly out of tune. Well temperaments spread the error so every key was playable but each retained a different character: keys with few accidentals sounded pure, remote keys sounded tense.

The Well-Tempered Clavier is regularly cited as a demonstration of equal temperament. It is not. Well-tempered means every key is usable, which is the point Bach was making; equal temperament additionally makes every key sound alike, which would have removed the variety that gave the collection its interest.
Equal temperament sets every semitone to the same ratio, the twelfth root of 2, roughly 1.0595. Twelve of them multiply to exactly 2, so the octave is perfect. Nothing else is. The fifth is about two cents narrow, which is inaudible to almost everyone. The major third is about fourteen cents sharp of pure, which is clearly audible as a beating roughness when the notes are sustained.

The mathematics was worked out by Zhu Zaiyu in Ming China in 1584, to twenty-five significant figures, and by Simon Stevin in the Netherlands at almost the same time. Whether the idea travelled between them is unresolved.
Equal temperament became standard on European keyboards during the nineteenth century, later than commonly assumed. The reasons were practical. Music was modulating through more distant keys, and instruments could not be retuned mid-piece. Fixed-pitch instruments had to be manufactured to a single standard. And an orchestra needs its keyboard to agree with everything else.

Musicians who work with historical temperaments argue that flattening key character removed something real: in a well temperament, a piece in E flat major genuinely sounds different in kind from one in C major, and composers wrote with that in mind. Early music performance has largely returned to period tunings for this reason.
Singers and string players, who are not bound to fixed pitches, drift toward pure intervals when playing without a keyboard, which is measurable. Barbershop harmony and much choral singing are closer to just intonation than to equal temperament, and the resulting chords are noticeably more resonant.
Some composers have gone the other way and divided the octave into nineteen, thirty-one or fifty-three steps, or abandoned equal division entirely. These remain marginal, largely because the instruments and the notation do not exist at scale.