When one plays a guitar, they are pressing down on the strings. Pressing down on different places on the string causes changes in tension, therefore changing the medium. When the medium is changed and you pluck the string, thereby creating a pulse, there is a change in frequency. The change in the frequency of the wave is what causes the string's audible change in pitch.
Depending on the pattern of the pulses and the frequency of the string, the string becomes a standing wave. When the natural frequency of the material is mimicked by a separate wave brought into contact with this material, it begins to vibrate. This concept of resonance can be exemplified by a 12-string guitar. For every one note on a 6-string guitar (E, A, D, G, B, e) the 12-string guitar has two, in varying octaves. Because each pair of strings has the same note but in different octaves, the natural frequency of the similar mediums are mimicking each other when played together. When one pair of strings is played at the same time, the waves bounce off each other, causing the strings to vibrate, much more than possible on a 6-string guitar. This is what gives 12-string guitars that unforgettable sound.