The key signature is the foundation of harmony as it provides the tonal centre on which the piece of music relates to.
Resolution is sense of completion or fulfilment in music and tension provides the variety and impetus which leads to that resolution.
Based on the principle that the major scale is generally accepted to be central to the Western tonal system, tonal forward motion is created by notes moving toward the establishment of a tonal centre, temporary or conclusive.
The authentic/perfect cadence is what comes to mind.
More specifically, if a major scale is played and then each note of the scale individually resolved, you will find that notes 2, 5 and 7 want to resolve directly to the tonic.
Inverting notes 2, 5 and 7 into 5, 7 and 2 gives the dominant triad.
For example in C Major (C, D, E, F, G, A, B) notes 2, 5 and 7 are D, G and B, which is an inversion of the G Major triad. (G B D).
Notes 3, 4 and 6 also want to resolve to the tonic.
However their natural resolution is indirect and moves by step.
For example in C Major the note E wants to descend over the D to the C; F over E and D to C; and finally A ascends over B to C.
Try playing through these notes to hear the various sounds of tension and resolution.
The strongest and most direct element of tonal forward motion is the dominant triad leading to the tonic.
This also works in minor keys, as the dominant triad has the same resolution properties.
By superimposing the idea of a dominant chord just before any chord, the principle remains the same.
The various combinations of sharps (#) and flats (b) that constitute each key signature are often learnt with reference to the Circle of 5ths: