The major contribution of the Middle Ear is the amplification of sound.
The Middle Ear Cavity sits opposite the external auditory meatus separated by the Tympanic membrane. Incidentally, the bone surrounding this cavity is very porous like a sponge.
God didn't tell me why but I suspect is helps to make the skull less heavy. There are some serious draw-backs to this as you will shortly see.
One problem with the Middle Ear is that the air pressures on both sides of the tympanic membrane are continually changing.
On the outside, changes in weather and/or changes in altitude cause the Tympanic membrane to be either sucked out or pushed in.
Air on the inside (middle ear cavity) also is continually being absorbed into the body causing a partial vacuum which sucks the tympanic membrane in. This can be very painful as anyone with an earache can attest. Nature has provided a mechanism (the Eustachian Tube) to equalize the pressure in the middle ear cavity.