The middle ear space is behind the eardrums, and it is linked to the back of the nose via the auditory tube or the eustachian tube as shown in the picture below.
Sometimes, when you have a bad cold or a sinus infection, the phelgm can travel from the back of the nose, up through the auditory tube and go into the middle ear.
When there is phelgm in the middle ears, you will feel some blockage, because it is affects the way your ear drum moves.
More stuff just for fun: Phelgm is fluid right, so it should conduct sound better, so shouldn't I hear louder instead of softer?
Yes, but in the middle ear, sound energy is converted to mechanical energy on the ear bones, so the fluid there actual reduces this mechanical energy and give you the sensation of blockage!