tonotopy
Tonotopy is the brain's way of laying out sounds by pitch, like the keys of a piano. Low notes and high notes each get their own spot, and the spots are arranged in order from low to high. This orderly layout starts inside your ear, in a coiled, fluid-filled tube called the cochlea, and is then copied onto the surface of the hearing parts of your brain. So the same neat ordering of pitches that begins in your ear is preserved, step by step, all the way up to where you consciously hear.
The cochlea pulls this off because of its shape and stiffness. Picture it uncoiled into a long ribbon: the end near the entrance is stiff and narrow, so it vibrates best to high-pitched sounds, while the far tip is floppy and wide, so it answers to low-pitched sounds. A pure tone makes just one stretch of that ribbon shake hardest, and the hair-like sensor cells sitting there fire off a signal. Because each position responds to a particular frequency, the place that lights up tells the brain the pitch. The brain's hearing regions keep this place code, so neighboring patches of cortex respond to neighboring pitches, and that is why we can tell a high whistle from a low rumble.
The map is approximate, not perfect: real-world sounds spread vibration across many spots at once, and the brain blends these to judge pitch.