Middle ear abuts the outer ear by the eardrum and the inner ear through the round window. It also communicates with the throat through the Eustachian tube.
It contains the ossicles (hammer, anvil and stirrup), whose mission is to propagate (filtering and amplifying/dampening) oscillations of the eardrum to the oval window. To that end they use two muscles (tensor tympani and stapedius), which control the movement of the ossicles to prevent transmission of sounds too intense that could damage the inner ear.
When a sound too strident reaches our ears, middle ear muscles dampen the movements of the ossicles and so reducing the amplitude of the oscillations (cushioning).
Unfortunately, the middle ear muscles do not respond instantly (can not absorb sounds of very short duration, such as a blast) and also fatigue quickly. So it is not advisable to be exposed to a loud sound source for a long period of time.
The inner ear is an hermetic cavity flooded by lymph. It consists of 3 components: the semicircular canals that control balance, the lobby, and the cochlea.
The vibrations reach the cochlea are transformed into nerve impulses that reach the brain via the cochlear nerve.
The cochlea (or snail) is a circular line coiled on itself. Longitudinally, the interior is divided into two parts by the basilar membrane is lined by hair cells that move with the pressure differences that travel through the lymph. These cells are very sensitive to deformation and are connected to the cochlear nerve endings.
By the structure of the snail, the hair cells resonate at different frequencies. Those that are closer to the middle ear vibrate with low frequencies and more remote, with high frequencies.