The dominant and subdominant chords help define the tonic chord. The dominant chord is a perfect fifth above the tonic, while the subdominant chord is a perfect fifth below:

These two chords create harmonic tension, which resolves into the tonic chord.
In the next example, listen to how the subdominant (IV) and dominant (V) chords help define the tonic. Also, listen to how the subdominant chord leads us to the dominant chord in the third measure. This example is in G major, beginning with the dominant chord:
Key: G Major
Tonic (I): G major
Dominant (V): D major or D dominant seventh
Subdominant: C major