Dominant7 and Tritone Substitution
The reason why dominant7 chords create the feeling of wanting to resolve results from the inherent structure of the chord, specifically the tritone that exists between the third and the seventh of the chord.
As an example, let’s look at this G7-chord, which has the tritone between b and f. Tritones have a strong tendency to resolve and can do this in two ways. Either inwards, becoming the root and 3rd of a C-chord (b becomes c, f becomes e) or outwards becoming the third and root of a Gb-Chord (b becomes bb, f becomes gb).
That means, that every dominant7 chord has two possible ways to resolve which conversely means that every tonic chord has two dominant7 chords that can lead to it. For C major as tonic that would be either G7 or Db7. Notice both chords contain exactly the same tritone b(or cb)-f that resolves towards c-e for a C major chord.
This is what is called tritone substitution in music theory which means that you can theoretically replace any dominant7 chord by a chord that is a tritone away from it (e.g. G7 and Db7 being a tritone apart).
That concept goes as far as being able to replace any chord that serves as a dominant (even if it doesn’t include that tritone (e.g. sus4 chords)) in the same way.