I'd imagine something along the lines of the very hot water causing the air to expand, along with the heat softening any wax blocking the eustatian and allowing proper equalisation of pressures.
The valsalva manouver (holding nose and mouth closed and blowing out) is the recommended procedure, however if you have a heavy cold it can also serve to force infected material (snot if you like) into areas it shouldn't be, meaning a worse infection. The big one is, if you have a heavy cold/blocked up nose/ears then don't fly!