“To answer this question, we first need some background information. A note’s pitch or frequency is measured in cycles per second; for example, A’ is 440 cycles per second. The distance between two notes, measured as the ratio of their pitches, is called an interval. If the interval between two notes is a ratio of small integers, such as 2/1, 3/2, or 4/3, they sound good together — they are consonant rather than dissonant. People prefer musical scales that have many consonant intervals.

There is no absolutely definitive list of consonant intervals because the concept of consonance involves subjective aesthetic judgment. However, the following seven pure intervals, smaller than or equal to an octave (2/1) and larger than unison (1/1), are commonly considered to be consonant.

In the past, people constructed scales based on pure or natural ratios of small integers. For example, the just intonation system uses the exact ratios shown in the table below. However, this method runs into serious problems. Although some of the intervals are perfect, other combinations of notes sound very bad (“wolf intervals”). After the Middle Ages in Europe, music became more complex, with more polyphony and more key changes, and these bad intervals became more common.

The modern equal temperament system was invented (in the 1500s) to solve this problem. (Galileo’s father, a music theorist, was one early proponent of equal temperament.) The octave is divided into twelve exactly equal intervals. In this system, the smallest interval, the semitone, is not a simple integer ratio, but is the twelfth root of two (21/12) or approximately 1.059. Larger intervals are multiples of the twelfth root of two, as shown in the table below. Although no interval (except the octave) is perfect in this system, the error is “spread around” evenly so there are no very bad intervals.”

Source