A car horn is designed to alert other vehicles and bystanders of a vehicle's presence. Smaller cars have higher frequency horns than large vehicles to allow them to be identified by the sound of their horn as either a small vehicle or a large vehicle.
To produce a sound when the horn is pressed, an electromagnet is used to cause a steel diaphragm to move. As the current is applied to the electromagnet, the diaphragm moves toward the magnet. When the diaphragm is moved to its maximum point toward the magnet, a connection is released, temporarily disconnecting the current and allowing the steel to relax. Once this happens, the electromagnet applies current, again moving the diaphragm toward the magnet. This cycle repeats evenly and causes the diaphragm to oscillate back and forth producing the sound of the car horn.
A car horn can sound like almost anything, many luxury cars have smooth sounding horns while the horn in an older economy car might sound whiny. This is also done to make the vehicle more identifiable to others. While it might take quite a bit of study to identify the exact car simply by hearing the sound of its horn, the most important thing to identify from the sound is the size of the vehicle.
For example, large vehicles, such as trucks or even train locomotives, have much deeper sounding horns. This has to do with the size of the diaphragm used in these vehicles. The larger surface area of the diaphragm and power of the electromagnet used contribute to the frequency and note that the car horn will produce. Many trucks also have air powered horns, which work by forcing air from the compressor that's used with the brakes past a diaphragm, causing sound.
Many states have mandates for auto manufacturers that require large trucks to have horns that are loud and low, to allow other vehicles to know that a large vehicle is approaching just by the sound of the horn. Smaller vehicles will have a higher pitched sound when the car horn is honked indicating that the vehicle is smaller in size. A good number of collector vehicles made prior to the 1970s use two horns — one with a low note and the other a high note — to allow the vehicle produce its distinctive sound.