You can see the perfect fourth and perfect fifth are very close to 4⁄3 and 3⁄2 respectively. This is basically just a coincidence and we use 12 notes per octave because there are these almost nice fractions. A major scale uses the 2212221 pattern because that hits all the best matches with low denominators, skipping 16⁄15 but hitting 9⁄8, for example.
For those who don’t want to break out a calculator, Wikipedia has it here:
https://en.wikipedia.org/wiki/Equal_temperament#Comparison_with_just_intonation
You can see the perfect fourth and perfect fifth are very close to 4⁄3 and 3⁄2 respectively. This is basically just a coincidence and we use 12 notes per octave because there are these almost nice fractions. A major scale uses the 2212221 pattern because that hits all the best matches with low denominators, skipping 16⁄15 but hitting 9⁄8, for example.