B (major) guitar chord chart with explanation
The C major chord consists of the three different tones C (1), E (3) and G (5). In the chord shape on your guitar these tones can appear in any order and some of them may also appear more than once. The root is normally played as the lowest tone.
You can get the tones of that major chord by going up from the root C to the major 3rd E by moving up 4 frets (=2 whole-steps). Then you move up a minor 3rd (1 whole-step + 1 half-step = 3 frets) to G. Major 3rd + minor 3rd together result in a perfect 5th. So G is called the 5th of C.
If you take a look at the intervals on the fretboard diagrams, you can see the root as 1, the major 3rd as 3 and the 5th as a 5. Only if the chord differs from that, additions are made to the chord symbol. A major chord is notated with just the root. In contrast a C minor chord is written Cm or C-, because it has a minor 3rd Eb (m3) instead of the major 3rd E. You may also find minor chords written with just the root as lowercase letter in older song books, but I would consider that way of writing as outdated and obsolete.
When you stack 3rds on each note of a scale, you get the so called diatonic chords of that scale. Major chords appear by nature on the 1st, 4th and 5th degree of a major scale by stacking two third over each note. The 1st, 4th and 5th degree of the major scale are called tonic, subdominat and dominant.
That means that in a song in the key of C major you may find the chords C, F and G, a song in the key of F may be accompanied with the chords F, Bb and C and in a song in the key of G major you may hear the chords G, C and D. Many songs (especially in folk, african or reggae music) are solely accompanied by those three major chords.