Modulation is when a piece leaves its home key and settles into a new one. The smoothest modulations move to a closely related key (one step around the Circle of Fifths), often via a pivot chord that belongs to both keys.
Pop songs often modulate up a semitone or whole tone for the final chorus — the 'truck driver' modulation. Classical music uses more elaborate routes.