A LOT of music is formulated something like this:
1 measure of G major
1 measure of C major
2 measures of D major
Repeat and repeat and repeat.
(I IV V V formula in G major)
It would be a bit boring to play just the root notes of those chords over and over and over. So what else can you do that will fit in with the chord structure?
Instead of (just quarter notes here, | is the measure break)
|G G G G |C C C C |D D D D |D D D D |
You can do:
|G B D B |C E G E |D F# A F# |D F# A F# |
That's just going root, third, fifth, third for each chord in the progression. You could go to the 6th or 7th instead of back to the third. Or change it up more and do root, fifth, 8th(octave), third.
If you've seen the movie “Back to the Future”, when Marty McFly starts playing Johnny B Goode, he tells the band “This is a blues riff in B, watch me for the changes and try to keep up.” He's told them everything they need to know. Key of B, blues chord progression.
Here's a good write-up on 12 bar blues (blues progression): https://en.wikipedia.org/wiki/Twelve-bar_blues
And here's what they do with it:
Yes, I know it's a movie, but it's a realistic scenario.