This concept is very useful to guitarists regardless of any particular style or genre of music being played. My explanation will be as simple as possible to include as many players as possible and their varied levels of music theory knowledge. Yes, it is helpful to understand music theory when playing the guitar.
First it is important to understand that any chord that is played is in a certain key that is based on a certain scale and the chord is in a certain position in that key. The most common scale used in Western Music is the Major scale. The example that is going to be shown will the use an Am7 chord in the key of G Major. The Am7 chord is based on the 2nd note in the G Major scale and the G Major scale uses all natural notes except for an F#. The natural harmony of the G Major scale is: Gmaj7, Am7, Bm7, Cmaj7, D7, Em7, F#dim7, Gmaj7. For you theory beginners an Am7 chord is not always in the key of G, which is another discussion.
What we are going to do is to follow the notes of a G Major scale up the 1st string on the guitar placing inversions of an Am7 chord underneath the melody note using all of the notes in the key in the melody including the notes not found in an Am7 chord. Using this concept on the chords of the tune you are playing with the proper melody note will enable you to play melodies with chords on the guitar.
It is best to use 3 or 4 note chords when doing this and obviously you can use the 2nd, 3rd and 4th strings for your melody note.
These kind of musical devices can be daunting for a person who hasn’t done them before, don’t let the difficulty scare you off. If you need to find a good teacher who knows his stuff who can take the time with you to explain what you don’t understand. Begin working. You can do it.