A bathroom mirror can be perfectly clear.
Then someone takes a hot shower and the glass turns cloudy.
The mirror did not change.
Tiny water droplets formed on its surface.
Warm air can contain water vapor
Air around us contains water in the form of invisible vapor.
Warmer air can generally support more water vapor before condensation begins.
That matters when warm humid air meets something cold.
The air next to the glass cools down
Imagine warm moist bathroom air touching a cold mirror.
The thin layer of air directly against the glass loses heat.
As that air cools, it may reach a point where it can no longer keep all of its water in vapor form.
Some of the water condenses into liquid droplets.
Why do the droplets make the glass look cloudy?
The droplets are tiny and spread across the surface.
Instead of allowing light to pass or reflect cleanly, they scatter it in many directions.
Your reflection becomes blurry.
The glass looks foggy.
Why does a car window fog on the inside?
People inside a car add heat and moisture through breathing and wet clothing.
If the glass is cold, moist interior air can condense on the inside surface.
The same basic physics is happening.
Why can the outside of glass fog instead?
On a warm humid day, an air-conditioned building can make the outside surface of a window cold.
Now the outdoor air touching that cold glass may condense.
The fog forms on the outside.
Which side fogs depends on where the moist air meets the cold surface.
How does defogging work?
Warming the glass, reducing humidity, or moving drier air across it helps evaporate the droplets.
That is why car defrosters and air conditioning can clear windows.
So the glass is not becoming cloudy internally.
It is wearing an extremely thin layer of tiny water drops.
Wipe them off and the mystery disappears with them.
A related explanation is Why do puddles disappear?, which looks at another familiar effect from the same general system.
And that’s the short explanation.
Related explanations: Why do puddles disappear?, Why does your breath show in cold air?, and Why does fog form?