Your middle ear is an air tight cavity that is isolated from your outer ear (and the outside world) by your tympanic membrane. Your middle ear does connect to the outside world via your eustachian tube, which joins your middle ear to the back of your nose (actually to your nasopharynx). This tube is normally collapsed, allowing your middle ear to remain air tight, but it does open when you yawn or swallow.
The reason your ears get "plugged" when you are in an ascending or descending airplane is because a pressure differential forms between your middle ear and the outside world. When you yawn, your eustachian tube opens and this allows the pressure between the two to equalize.
And that is why yawning "pops" your ears when they are plugged.