In the Just temperament, the attempt is made to make all intervals, at least in one key, be as close to having whole number ratios as possible. This should make as many intervals in the music as pleasing as possible.
The following gives the rations.
Name ratio Modulation Relative Minor 5th Harm Melodic up dn Up Dn p4 2/3 1 p5 3/4 9/8 M6 5/6 5/4 1 1 1 m7 8/9 4/3 M7 15/16 9/8 9/8 9/8 U 1 3/2 6/5 6/5 6/5 T=9/8 M2 9/8 -| 27/16 27/20 27/20 27/20 S=16/15 | m3 6/5 | T=10/9 S=25/24 | M3 5/4 -| 15/8 3/2 3/2 3/2 S=16/15 p4 4/3 -| 2 8/5 8/5 | a4 25/18 |- T= 9/8 5/3 | p5 3/2 =| 1 9/5 | a5 25/16 |- T=10/9 15/8 15/8 | M6 5/3 -| 10/9 2 2 2 S=27/25 m7 16/9 S=25/24 M7 15/8 5/4 S=16/15 O 2 4/3 M2 9/4 3/2 m3 12/5 M3 5/2 5/3 p4 8/3 a4 25/9 50/27 p5 3 2
In just tuning tones and semitones are not the same size. The primary tones are either 9/8 or 10/9 (significantly flatter). Similarly the semitones vary from 16/15 to 25/24 (the latter being about 2/3 the size of the former).
One of the most important features in the development of a musical piece is the modulation- the treatment of the old fifth as the base of the new octave. If fact the size of the major second and of the major seventh have been chosen precisely to make the rations of the modulated scale the same as the original, whether major or minor scale. Both of these intervals are inharmonious anyway, and exactly what their inharmony is is to an extent irrelvant. However one would like them to be always the same. If I choose the major second so that the modulation up of a fifth again has a good fifth ( and because of the importance of the fifth, one would surely want this) , then the sixth in the modulation down by a fifth is no longer harmonious (27/20) (bearable since the sixth is not as important an interval in music as the third and the fifth).
In addition to the major mode, there also exist a number of minor modes. These are characterised particularly by the lowered third. These differ in their treatment of the larger intervals. In the harmonic minor the sixth is lower than what it is in the major scale. In the melodic, the mode going up in the scale is different from that going down- the sixth and seventh being lowered from the size they would have in the major scale.
An important relation between the major and minor scales is that of the "related minor key" to a major key (down by a minor third from the base of the major key). This is the minor scale with the same key signature (ie number of flats or sharps listed at the beginning of the piece), and composers would modulate by going into the relative minor from the major. Again with the above choice for the second, the ratios of the lower intervals are harmonious. However, to make the related major sixth of the minor key the same as the major sixth of the original, one has to choose the augmented fourth as shown. This however makes the modulated major seventh differ from the orginal.
These conflicts become more and more severe as one goes to more "distant" keys. (keys obtained through successive modulations from the original), and as time progressed composers began experimenting more and more with such keys.
The development of the various temperaments was an attempt to change the intervals from the most harmonious just intervals, making them inharmonious to a greater of lesser extent, but such that all keys on a keyboard instrument will be useable (see the Well Tempered Clavier by Bach as an example where Bach was demonstrating that all the keys in one of the temperaments were useable, even though different.