paison!
And the “reason” it sounds that way:
Whenever something with a natural resonance is sounded, we hear harmonics. There may be a fundamental note, but various overtones may also sound. So, we might hear an A, but also to varying degrees the 2nd, 3rd, 4th, 5th, 6th multiple of the frequency of that A. So, since we’re used to them, or maybe there’s even an underlying physical reason, they sound good together. The 2nd and 4th multiples are just A, one and two octaves higher. The 4th, 5th, and 6th multiples are the major chord. (The 6th is the same note as the 3rd, as well, one octave higher.)
In the C major chord described above by friedo, the E has a frequency 5/4 times C, and G has 6/4 times C.
In that twelve semitone scale, a note four semitones above has about 5/4 the frequency, and seven semitones above has about 6/4 the frequency. They form a major chord.
The distance between such notes as I described them are not exactly equal, but we can “adjust” them slightly so that the steps are all equal. That makes it easy to transpose scales. So, that’s often what we do, “tempering” them.
The ratio between each semitone is then 2^(1/12), so that 12 semitones would be an octave ( 2^(1/12)^12, which equals 2 ). So, in the tempered scale like we might use on pianos, the fourth semitone is actually 2^(4/12) higher, or 1.26 instead of 1.25 (5/4). The seventh is actually 2^(7/12), or 1.498 instead of 1.5, but it’s close!