The ear has three parts: the outer ear, middle ear, and the inner ear. The first two are air filled; the latter is fluid filled. It contains the cochlea with the sensory cells that detect the sound.
The outer ear consists of the pinna, which, in contrast to animals, does very little in humans, and the external auditory canal. At the end of the external auditory canal is the non-cellular tympanic membrane.
The tympanic membrane has air on both sides and thus readily captures the sound energy travelling down the external auditory canal. If it had fluid on the inner side, it would reflect about 99% of the sound energy. Thus, the air-filled middle ear is crucial.
The air-filled middle ear is connected to the pharynx via the Eustachian tube, which keeps the pressure on both sides of the tympanic membrane the same.
But how is the sound energy transfered into the cochlea, where the sensory cells are found? That is the function of the three ossicles, which form a lever system that transfers movements of the tympanic membrane to the oval window. This lies between the middle ear and the fluid-filled cochlea.
A crucial feature of the system is that the area of the tympanic membrane is about 25 times larger than that of the oval window. This allows all of the energy collected by the tympanic membrane to be applied to a much smaller area. This magnifies the force per unit area by 25 times, allowing the sound energy to enter the fluid of the cochlea. In this way, the sound energy is efficiently transfered with little reflection from the air to the fluid-filled cochlea.
The cochlea is essentially a long tube that is divided down the middle by the basilar membrane. The sound energy entering via the oval window is all applied on one side of the basilar membrane. Thus, sound entering the ear starts the basilar membrane vibrating.
But the basilar membrane is not uniform along its length, and different parts of the basilar membrane move the most in response to different frequencies of sound.
The portion of the basilar membrane near the oval window is more narrow and stiff. It thus moves preferentially with high frequencies. At the other end, the basilar membrane is wider and more flexible. This end moves most in response to low frequencies. Thus, the basilar membrane is laid out like a piano keyboard, with different frequencies (pitches) moving different regions preferentially.
The primary sensory cells in the cochlea are the hair cells. They lie along the basilar membrane. Thus, when the basilar membrane moves up and down, the hair cells move up and down.
The hair cells have projections at their top called stereocilia. When the stereocilia are moved, mechanically gated ion channels open, the hair cells are depolarized and as a result glutamate is released as a neurotransmitter. The glutamate then causes depolarization of the next neurons, which have axons that form the vestibulocochlear nerve.
But why are the stereocilia moved when the hair cells move up and down? This is because of the tectorial membrane, which lies over the stereocilia. The stereocilia are tweaked because the tectorial membrane does not move up and down when the basilar membrane moves up and down.