D7th is the Dominant 7th chord in the key of G Major. When we hear a dominant 7th chord (which has an unresolved feeling) our ear expects (almost demands) that the next chord provides a resolution. To provide a resolution to a Dominant 7th chord you would play the Tonic or home chord of the current key, in this case G Major. This applies to all keys.
There's some good lessons and further reading here :-
Related chords, the key and changing keys
Music Theory Basics
Chord Construction
It's a lot to take in at first so ask questions if you're still not sure of anything.