Close your eyes and imagine it's night and a train whistle travels by. Then think about it a moment.
Sound waves are like little pushes of air.
When the thing making the sound is moving toward you, the pushes get pushed together even tigher and the pitch goes up. When it moves away from you, the opposite thing happens and the pitch goes down. It's called the Doppler effect. That makes them higher-pitched. As the car and the horn move away from you, the pushes of sound are spread out, further apart.