It turns on at a certain engine temperature, regardless if the car is on or off. With-out coolant flowing after turning a car off, the temperature is still high, and usually increases a few degrees before dropping. The fan cuts-on and cools it off...