This is a summary of what I understood about the substitute dominant from a conversation with my colleague Rafael Delgado Buscalioni, who is proficient in music theory. The idea is how to build “another” dominant chord. Say we have a regular, major C chord: C-E-G. The dominant is G major: G-B-D. A typical choice is to include the subdominant in the later, thus adding tension – this leads us to the dominant seventh, G7: G-B-D-F. (this is the way 7th chords entered Western music, it seems!).
By keeping the “tension” notes, we are led to the Secondary dominant, Db7: Db-F-Ab-B.
This is why:
Let us keep, as said above, the “tension” notes: B (the subtonic, signaling an impending return to the tonic.) and F (the 7th of G). But, let’s reverse them, so that F is the major third on the new chord, and B its 7th (we want to keep a 7th chord).
The outcome can only be one: Db7, which indeed runs Db7-F-?-B, the unknown note being a sweetly dissonant Ab, present in a C-E cadence, as in Buffalo Springfield’s Burned (“now you’s running away…”) or Dylan’s Don’t Think Twice, It’s Alright: C-E-F-Dm. It’s also interesting that Db7 an G are separated by a tritone , and so are B and F! (Sooner or later, everyone ends up mentioning tritones in jazz harmony.)
This sound really well in jazz and bossa. Try, for example, instead of a C-Am-G7 cadence, a C-Am-Db7 one. Or, instead of C-A-D-G7, C-A-D-Db7.
Moreover, for reasons I have partly forgotten, the chord should be extended with an E: Db-F-Ab-B-E, producing the very jazzy Db7#9.