When you hear a sound, this is your ear detecting the pressure variations caused by a sound wave.
The wave travels down the ear canal where it reaches the eardrum, the boundary between the outer and middle ear. The air on the inside of the eardrum is vented to the outside by the eustachian tube and is held at atmospheric pressure, so the pressure variations on the other side result in a fluctuating net force over it. This drives it to oscillate back and forth with the same frequency as the wave. The eardrum moves three tiny bones, called the ossicles, in the middle ear, shifting fluid inside the spiral-shaped cochlea of the inner ear, and causing the vibration of many tiny hair cells. The vibration of these hair cells then produces nerve signals that are sent to the brain and interpreted as a sound.
If you’ve ever been in an airplane before, you’ll know that when you get to a high altitude where the pressure is lower, everything starts to sound muffled until you “pop” your ears. This "pop" is actually the opening of the eustachian tube and the equalization of the pressure inside the ear to the new atmospheric pressure. Before you do this, the air on the inside is at a higher pressure than the outside, which pushes the eardrum outwards and makes it less sensitive to any variations in pressure from the outside.
This is similar to why you feel discomfort in your ears when diving deep underwater. The pressure exerted on the outside of your eardrum by the water is much higher than the pressure of the air on the inside, so your eardrum is pushed inwards.