What makes partial deafness occur when one has a cold?

2 possibilities. A cold or a viral infection often leads to Eustachian tube swelling and a middle ear fluid problem. More rarely, the virus (cold) can lead to inner ear hearing loss.
Eustachian tube. When you have a cold, the eustachian tube (the tube that connects the ear with the back of the nose) usually gets plugged. Once plugged, even a little, the pressure in your middle ear usually become negative, like a vacuum. This negative pressure restricts the motion of your eardrum. When the eardrum doesn't vibrate like it normally does, you have some temporary, but real hearing decrease.