An important part of accompaniment is keeping the key. This is best achieved with chords maintaining a solid progression. There are thousands of chords to be found on the guitar neck. The most commonly used ones for accompaniment are open chords, power chords, and barre chords. The type you use will depend on the style of music. Barre chords are associated with blues, jazz, rock, and reggae. Power chords are typically used for harder rock styles like punk or metal, and open chords are great for simpler songs or folk music.
Another great way to keep the key of the song is with arpeggios. These are like chords, but instead of playing the full chord, you'll spell it out one note at a time. Arpeggios are best used for slower songs, ballads, and songs in minor keys. They offer a kind of impassioned feel. One great example of a song using arpeggios as accompaniment is "House of the Rising Sun" by the Animals.
Maintaining rhythm and dynamics is also important to any accompaniment. A talented accompanist will keep the lead part in key and on time. Counting off is crucial to making a song sound acceptable. You must think of the guitar as not only a way of keeping the key, but also as a kind of percussion instrument. Some musicians even take the step of tapping on the body of the guitar. Palm muting is good for this purpose as well. To palm mute a note or a chord you should hover your palm just above the string or strings so that it barely touches. When you do, the note will be audible, but it will not ring out. Palm muting keeps the accompanying part quieter too, which further highlights the lead.