Secondary dominants
You know that V7 pulls hard to I — the leading tone climbing home, the 7th falling. A secondary dominant borrows that pull and points it at a chord that isn't the tonic. It's the single most common way tonal music adds a splash of chromatic colour.
"A dominant of a dominant"
In G major, the dominant is D. What's the dominant of D? It's A — and A7 (A–C♯–E–G) pulls toward D exactly the way D7 pulls toward G. Drop an A7 into a G-major phrase just before the D chord, and for one moment D feels like a mini-tonic. That A7 is written V7/V ("five of five").
The tell: an unexpected accidental that resolves up
You spot a secondary dominant on the page as a sharp (or natural) that doesn't belong to the key — and it almost always resolves up by a half step into the next chord's root or 3rd. The C♯ above, in G major, is the giveaway: it's not in the key, and it climbs to D.
Any diatonic chord can get its own secondary dominant: V7/ii, V7/iii, V7/IV, V7/vi. In a Mozart or a Schubert phrase you'll see several in a row — a chain of little "arrivals" on the way to the real cadence.
This is called tonicization
Making a chord briefly feel like a tonic — without actually changing key — is tonicization. A secondary dominant is how you do it. If the new "tonic" sticks around for a while with its own cadence, that's a full modulation (Movement C); a quick in-and-out is just tonicization.
Try it
Try
Play a G major arpeggio, then an A major arpeggio (A–C♯–E), then a D major arpeggio. Hear how the A major — with its C♯ — makes the D feel like home for a second. Now play G, then D7 (D–F♯–A–C), then G: the C natural pulls to G. Same mechanism, aimed at a different target.
The usual mistake
Reading the out-of-key accidental as a mistake or a modulation. It's neither — it's a borrowed pull, on loan for one chord. Follow it: it will resolve up a half step, and then the music is back in the home key as if nothing happened.