3 - pin case fans use = voltage, ground, and rpm sensor
4 - pin case fans use = voltage, ground, rpm sensor, and PWM = fan speed control
Pulse-width modulation
http://en.wikipedia.org/wiki/Fan_control
Pulse-width modulation (PWM) is a common method of controlling computer fans. A PWM-capable fan is usually connected to a 4-pin connector (pinout: Ground, +12 V, sense, control). The sense pin is used to relay the rotation speed of the fan and the control pin is an open-drain or open-collector output, which requires a pull-up to 5 V or 3.3 V in the fan. Unlike linear voltage regulation, where the fan voltage is proportional to the speed, the fan is driven with a constant supply voltage; the speed control is performed by the fan based on the control signal.
The control signal is a square wave operating at 25 kHz, with the duty cycle determining the fan speed. Typically a fan can be driven between about 30% and 100% of the rated fan speed, using a signal with up to 100% duty cycle. The exact speed behavior (linear, off until a threshold value, or a minimum speed until a threshold) at low control levels is manufacturer dependent.
Many motherboards feature firmware and software that regulates these fans based on processor and computer case temperatures.