Kbase Article of the Week: About Fans and Fan Noise in Your Apple Product →

Apple Support:

If your device’s processor is working on intensive tasks—such as compressing HD video, playing a graphics-heavy game, or indexing the hard drive with Spotlight after you migrate data—the fans run faster to provide additional airflow. You might hear fan noise when this happens, especially if you’re in a quiet environment. This rushing-air sound is a normal part of the cooling process.

Ambient temperature, the temperature outside the device, also plays a role in the fans’ responsiveness. If the ambient temperature is high, the fans turn on sooner and run faster.