A moving source keeps emitting waves at a constant rate, but each new wave starts from a slightly different position. Moving toward the observer, each wave is emitted a little closer than the last, so the wave crests arrive squeezed together — a shorter observed wavelength, shifted toward blue. Moving away, each wave starts a little farther off, stretching the crests apart into a longer wavelength, shifted toward red. The source's own frequency never changes; only what the observer receives does.
Wavefronts in Space
Wave Arrivals Over Time — Emitted (top) vs. Observed (bottom)