The condenser fan is vital for the air conditioning system. The A/C condenser sits in front of the radiator and receives hot, high-pressure gas from the compressor. To cool this gas down so it condenses back into liquid, air must pass through the fins. When you are parked or driving slow, there is no wind to cool the condenser. The electric condenser fan turns on automatically to draw air through the fins, keeping the system operating.
If the fan motor fails, the condenser cannot shed heat when the car is idling. Refrigerant pressure will climb, causing the safety switch to cut off the A/C compressor. Your A/C will blow warm at red lights but start blowing cold again once you drive fast enough to force air through the grille.