The story
You stand safely on a sidewalk as an emergency vehicle approaches. Its siren sounds high and urgent. After it passes, the sound seems lower. The driver did not necessarily change the note. Motion can change what reaches your ears.
Sound travels through air as a pattern of changing pressure. A steady tone repeats that pattern at a certain rate. Your ear hears a higher pitch when more repeats arrive each second and a lower pitch when fewer arrive.
Picture the siren sending out one part of the pattern, then moving forward before sending the next. Ahead of the vehicle, the newer wave starts closer to the older one. The waves are crowded together. They reach a person in front more frequently, so the pitch sounds higher.
Behind the vehicle, the opposite happens. The source moves farther away between repeats. The wave pattern is stretched out, and fewer repeats reach a listener each second. That listener hears a lower pitch.
This change is the Doppler effect. It depends on motion toward or away from the listener, not simply on being a moving vehicle. A source traveling sideways across your view has a different toward-or-away motion from one driving straight at you.
It also helps separate two things we often mix up. A distant siren may become quieter because less sound reaches you. That change in loudness is different from a change in pitch. Turning down a speaker can make the same note quieter without making it lower.
Real sirens often change their own notes on purpose, which can make the effect harder to isolate. But imagine a source holding one steady tone. Even then, its motion can give the people ahead and behind it different versions of the same note. Sound is carrying information about movement as well as the source.