There is a muscle in your ear that when contracted, moves the bone away from the ear drum and prevents vibrations from sound waves from happening as effectively. This is linked through your face to your mouth. When you open your mouth, whether to yawn, cough, or even talk, it can cause the muscle to contract, acting in a way as noise cancelation for sounds you make yourself.
Your inner ear, mouth, and nose are connected as a way to equalize air pressure; otherwise severe air pressure differences (e.g. ascending in a high-speed elevator or plane) will cause extreme pain or even rupture the thin eardrum.
When you open your mouth widely (or learn to flex specific jaw muscles), eardrum mechanism “disconnects” to equalize pressures safely.
When you yawn, your ears can feel funny because of something called the Eustachian tubes. These tubes help equalize the pressure in your ears, like when you’re on a plane and your ears pop. When you yawn, those tubes open up, and that can change the air pressure inside your ears for a moment.
This pressure change can make sounds seem quieter or even muffled, kind of like when you cover your ears.
In addition to what’s others say, there’s a muscle that gets stretched during yawning called the Tensor tympani. This muscle is what pulls on the eardrum to keep it taught and micro adjustments help with fine tuning hearing (some people can actually flex this muscle which causes the “ear rumbles”).
When the tension of the eardrum changes, its ability to transmit sound through the hearing bits of your head (a series of bones and a special “hearing organ” called the cochlea) also changes, and big changes away from your normal make hearing worse.
Latest Answers