A dominant chord a group of three or more tones forming a harmony is a Major chord built on the fifth degree of the Major or minor scale a group of pitches arranged from high to low covering one octave. The chord progression V to I is a strong progression. This dominant to tonic progression establishes the tonal center on the tonic. It is used at the end of a phrase or at the end of a piece to create the feeling of arrival or of completion.
A secondary dominant is a temporary dominant built above a scale degree other than the tonic. It is a Major chord or a dominant 7 a Major chord with a m7th built on the fifth degree of the Major or minor scale, V7 chord that is built a perfect fifth above one of the scale degrees. It requires at least one note outside of the original scale.
This progression is in the key of C Major. The fourth chord, V7 of ii, is a secondary dominant. In C Major it forms a temporary dominant of ii, d minor. If this were the key of d minor, this would be a V7 to i progression. However, it is in the context of a larger progression in the key of C Major. Therefore it is written V7 of ii to show that it is temporary, and that it is a secondary dominant.
Secondary dominants provide the strong progression of root movement V to I. This helps give the music a feeling that it is moving forward. They also introduce notes outside of the key. This adds variety.
Secondary dominants are easy to spot in a score because of the accidentals they require. When you first look over this example, the fourth chord stands out because it has an accidental, a sharp sign, C#. Raised tones in a score are often the 3rd of a secondary dominant. Lowered tones are often the 7th of a secondary dominant.
see also: Roman Numeral Analysis, Staff Roman Numeral Chords, Roman Numeral Chords