In Pythagoras and strings I explained how Pythagoras established the pitch within the octave. A fine system that sufficed during a long period.
However, in the Middle Ages polyphony evolved in western music which gave problems. Counting with pure fifths over several octaves caused problems, especially with the major third. The first adjustment was the so-called meantone tuning, and later this resulted in the Equal Temperament and Well Temperament.
The German music theorist Andreas Werckmeister (end 17th century) developed a tuning which he called 'wohltemperiert' and which Bach has defended in his Wohltemperierte Klavier. That was not yet quite our Well Temperament, but he was the first to make the fifth slightly smaller. In the temperament of Werckmeister, keys still had their own ‘colour’. So Bach did not defend the Well Temperament with his Wohltemterierte Klavier, the tuning which we are used to today, but indeed a tuning with more possibilities than was customary until then.