Most people learn a few chords when starting out learning guitar. There are several easy songs that can be played using nothing more than C Major, D Major, E Minor, and G Major. What are chords, though? This bit of musical theory trivia is lost on many guitarists because it is not very obvious looking at a chord on the neck of a guitar what makes it a chord.
A chord, in its most basic music theory definition, is three or more notes played at one time. However, anyone who has messed around strumming random guitar notes knows that most combinations of three or more notes are not very pleasant chords. This is why musical sounding groupings of notes are given chord names that reflect how they are played. Each chord of a given type, like Major or minor, is played in the same way relative to the note it is based on, like C or G. This is very obvious to see from looking at a chord played on a piano since the notes on a piano are laid neatly in order. On a guitar, it is difficult to see exactly what is going on in terms of musical theory, but guitarists play the same chords as pianists.
The most basic form of a chord is a Major chord. Major chords are based on the Major scale, which is the typical, upbeat musical scale. Every Major chord is played with three notes that correspond to the first, third, and fifth notes of the Major scale of the note it is based upon. A C scale, for example, goes C, D, E, F, G, A, and B. The first note is C, which is the base of the scale. The third note is E, and the fifth is G. C, E, and G played together is a C Major chord, which is done on the guitar by playing the low C on the A string, the E on the D string, an open G string, a high C on the B string, and an open high E string. Note that there are five notes being played, but each of them is either C, E, or G, so it is still a C Major chord.
Minor chords work similarly but are played on the minor scale instead of the Major scale. For example, the A minor scale is A, B, C, D, E, F, G. Note that the A minor scale has the same notes as C major because A is the relative minor of C. The only difference between these two scales is the order in which the notes are played. The minor scale has a more subdued, melancholy sound than the Major scale, and the same goes for minor chords. The chord of a minor scale is formed the same way as the chord of a Major scale; the first, third, and fifth notes. In the case of A minor, this is A, C, and E. A minor is played with the open A string as the base, with E played on the D string, a higher A played on the G string, a C played on the B string, and the high E string open. Again, five notes played, but each of them A, C, or E, making an A minor chord.
Chords on the guitar work the same way musically as on a piano or other instrument, but are a little more confusing because of the way notes are laid out on the neck of the guitar. This is why guitarists learn chord shapes, rather than trying to pick out each note of a chord individually, to make strumming a song easier. Chords are an easy, basic way to play a song, so learning a lot of them is a big advantage for new guitarists!