We're using mostly root chord shapes here. That means the main chord note is played on the low D string. Notice how the shape for C and F is the same. In this vamping arrangement, the G is played using the 1st inversion shape - also known as the "D" shape. The "D" shape is only a D chord if you play it down at the 4th fret. Play it anywhere else and it's a different chord, but it's still gonna be a major chord unless we change the tuning of the banjo.
Every key has common chords. Have you ever heard any one say, "It's just a 1, 4, and 5 in the key of G"? What they are talking about are common chords. The chords, and the numbers that represent them, are based on the scale notes of that key. In the key of C, the C chord, F and G are your common chords and 1 4 5. That's about as much detail as we'll go into here.
Check out the licks for some nice variations that combine root shapes and chord inversions to get beautiful sounds that almost create a melody unto themselves. There's also some simple walks, and more fancy Scruggs riffs that can be used to add variety mid song, or to "fill" and add a hot lick at the end of the last vocal phrase.
Try to memorize some of these chord shapes and even some of these licks. Then, play backup to the melody. Really try and hear how the chord changes connect to that basic melody. If you are in a jam this can be a great guide for you to think through or to follow if someone else is singing or playing a lead that is melody based.