i got this from a book

"Secondary Dominant (V of V)
In the Key of C, the second chord (II), is a minor
chord: “Dm”. If you see a “D7” we are not in “C” anymore.
D7 is the V7 of “G”; G7 is the V7 of “C”. D7 is the “V of V”
AKA Secondary Dominant.
This a Key Center Change to a neighboring Key. If we
are in the Key of “C” then the new Key is “G” or “Gm” and
the “V7” of “G” or “Gm” is D7. This also helpsdetermine
which scale(s) the Lead Player uses for soloing. "

i have no idea what it says though so could someone reiterate it or explain better
Basically, you can get a chain of V-I resolutions going. If you resolve from D7 to G, that's a V7-I resolution, and then you can resolve from G7 to C, which is another V7-I resolution.

But that also means that technically, while you are resolving from D7 to G, there's an implicit key change to G.

That's my understanding, which is probably woefully inadequate.
METAR KTIK 040043Z COR RMK TORNADO 1W MOV NE. EVACUATING STATION
The dominant chord of a scale is the V chord. The strongest chord progression you can have is V-I, the dominant to tonic progression. The strongest version of this is the V7-I.

When you harmonize the major scale only one chord will ever be a dominant 7 chord. This is the V, the dominant chord. If you see a dominant7 chord that is not the V chord of the key you are in then the notes making up that chord are oustside the key. It is considered a secondary dominant.

When you are in the key of C and you see D7 the D7 is not part of the harmonized C scale and not in the key of C. There is only one key that a D7 will naturally belong to and that is G.

When in the key of C, and a D7 is used, it is considered a secondary dominant. If it is followed by a G then it is a functioning secondary dominant because it is resolving down a fifth and will make the G feel stable enough to be the tonic chord. (It will tonicize the G).

If it is not followed by the G then it is a non functioning secondary dominant since it is not acting to tonicize another chord by resolving down by a fifth.

I am pretty sure that's right though I haven't spent time studying secondary dominants specifically I've kind of just picked it up in passing.
Si