Sounds that sound good together have frequencies that are whole number ratios of each other. (This means they have harmonics that align. If they don't align, you get a beat frequency which sounds objectionable.)
A 3:4:5 ratio is a major triad. A good scale should have as many major triads as possible with the least number of notes.
So, let's call the root of our scale 1/1. You might want to build a major triad there, so you have 1/1, 5/4, and 3/2. If you build a triad off of 3/2, you'll end up adding a couple more notes: 15/8 and 9/4. If you add 4/3 as a note and build a triad there, you'll end up adding 5/3 and 2/1. 2/1 is the octave, so we can pretend it's equivalent to 1/1, and 9/4 is an octave above 9/8, so we can substitute 9/8.
So, our scale is 1/1, 9/8, 5/4, 4/3, 3/2, 5/3, and 15/8, and we have the major scale. It is possible to construct 3 major chords and 2 minor chords (10:12:15 ratio) from those seven notes. If you add 10/9 (slightly flat of 9/8), you can add one more minor chord.
By a mathematical coincidence, we can approximate these values pretty closely with various powers of the twelfth root of 2:
x = 2^(1/12)
1, x^2, x^4, x^5, x^7, x^9, x^11
The latter scale is equal tempered, whereas the former is "just" (untempered). The ET scale has very accurate fourths and fifths, but thirds and sixths are far enough off that they don't sound quite as nice in chords. We tend to put up with that in modern music, though.
A 3:4:5 ratio is a major triad. A good scale should have as many major triads as possible with the least number of notes.
So, let's call the root of our scale 1/1. You might want to build a major triad there, so you have 1/1, 5/4, and 3/2. If you build a triad off of 3/2, you'll end up adding a couple more notes: 15/8 and 9/4. If you add 4/3 as a note and build a triad there, you'll end up adding 5/3 and 2/1. 2/1 is the octave, so we can pretend it's equivalent to 1/1, and 9/4 is an octave above 9/8, so we can substitute 9/8.
So, our scale is 1/1, 9/8, 5/4, 4/3, 3/2, 5/3, and 15/8, and we have the major scale. It is possible to construct 3 major chords and 2 minor chords (10:12:15 ratio) from those seven notes. If you add 10/9 (slightly flat of 9/8), you can add one more minor chord.
By a mathematical coincidence, we can approximate these values pretty closely with various powers of the twelfth root of 2:
x = 2^(1/12) 1, x^2, x^4, x^5, x^7, x^9, x^11
The latter scale is equal tempered, whereas the former is "just" (untempered). The ET scale has very accurate fourths and fifths, but thirds and sixths are far enough off that they don't sound quite as nice in chords. We tend to put up with that in modern music, though.