In front of a moving sound source, the wavelength of the sound wave is shortened. Successive wavefronts are emitted from positions progressively closer to the observer, so the wavefronts bunch together in the direction of motion.
Because wave speed in a given medium is approximately fixed, wavelength and frequency are linked by v = fλ. When the wavelength decreases while sound speed remains essentially constant, the observed frequency increases. That higher frequency is heard as a higher pitch. Behind the source, the wavefronts spread farther apart, producing a longer wavelength and lower pitch.
The effect was described by Austrian physicist Christian Doppler in 1842 and is often demonstrated by a passing siren. The common mistake is to say that the source changes the sound’s amplitude or timbre. Those qualities can change for other reasons, but the basic front-versus-back Doppler effect concerns spacing between wavefronts, or wavelength. For sound, the motion of both source and observer is measured relative to the medium, usually air.