Here is a web reference that should answer your question better than I could: http://cnx.org/content/m11639/latest/
There are times when tuning is not much of an issue. When a good choir sings in harmony without instruments, they will tune without even thinking about it. All chords will tend towards pure fifths and thirds, as well as seconds, fourths, sixths, and sevenths that reflect the harmonic series. Instruments that can bend most pitches enough to fine-tune them during a performance - and this includes most orchestral instruments - also tend to play the "pure" intervals. This can happen unconsciously, or it can be deliberate, as when a conductor asks for an interval to be "expanded" or "contracted".
But for many instruments, such as piano, organ, harp, bells, harpsichord, xylophone - any instrument that cannot be fine-tuned quickly - tuning is a big issue. A harpsichord that has been tuned using the Pythagorean system or just intonation may sound perfectly in tune in one key - C major, for example - and fairly well in tune in a related key - G major - but badly out of tune in a "distant" key like D flat major. Adding split keys or extra keys can help (this was a common solution for a time), but also makes the instrument more difficult to play. In Western music, the tuning systems that have been invented and widely used that directly address this problem are the various temperaments, in which the tuning of notes is "tempered" slightly from pure intervals. (Non-Western music traditions have their own tuning systems, which is too big a subject to address here.)
As mentioned above, the various tuning systems based on pure intervals eventually have to include "wolf" intervals that make some keys unpleasant or even unusable. The various well temperament tunings that were very popular in the 18th and 19th centuries tried to strike a balance between staying close to pure intervals and avoiding wolf intervals. A well temperament might have several pure fifths, for example, and several fifths that are smaller than a pure fifth, but not so small that they are "wolf" fifths. In such systems, tuning would be noticeably different in each key, but every key would still be pleasant-sounding and usable. This made well temperaments particularly welcome for players of difficult-to-tune instruments like the harpsichord and piano.
Note: Historically, there has been some confusion as to whether or not well temperament and equal temperament are the same thing, possibly because well temperaments were sometimes referred to at the time as "equal temperament". But these well temperaments made all keys equally useful, not equal-sounding as modern equal temperament does.
As mentioned above, mean-tone tuning was still very popular in the eighteenth century. J. S. Bach wrote his famous "Well-Tempered Klavier" in part as a plea and advertisement to switch to a well temperament system. Various well temperaments did become very popular in the eighteenth and nineteenth centuries, and much of the keyboard-instrument music of those centuries may have been written to take advantage of the tuning characteristics of particular keys in particular well temperaments. It is interesting to note that the different keys in a well temperament tuning were sometimes considered to be aligned with specific colors and emotions. In this way they may have had more in common with various modes and ragas than do keys in equal temperament