when you have a warm shower, you create steam. So when the warm steam flows in the air and starts to be in contact with a cold surface, it condenses causing a mist to form on the cold surface. The heated mirror is warm so, when, the steam is in contact with the mirror condensation is prevented. Therefore, the mirror stays clear.