Why does a speed-controlled computer fan require 4 pins?
While the statement that "any DC motor can be driven with PWM" is broadly correct* if the actual motor is PWM controlled, in a given implementation the motor proper may be hidden behind an internal controller, and this the case for the very large majority of devices that use small BLDCMs (Brushless DC motors). 

Most small modern fans use BLDCM's.
 In a BLDCM the motor speed is notionally independant of applied voltage. A range of voltages will be requied to operate correctly but within that range the voltage will have either essentially no effect on motor speed or a second order one.

If a system uses PWM to control an external motor's speed, special attention will be required to translate the speed control signal into actual control of speed. A BLDCM usually uses magnetic sensors ** (usually Hall sensors) to determine rotor position and to switch voltages appropriately. The electronics may be as simple as the sensors but more usually there is a control IC. If voltage is changed the controller will usually attempt to oppose any change and maintain constant speed. A PWM signal or a DC level could be used as a signal to a controller re appropriate speed. 




Some DC motors are not overly keen on being PWM'd due to interesting arrangements of field coils. While small brushed DC motors in consumer equipment may use permanent magnets, larger motors tend to have wound rotors and may have fields in series ("Universal motor" as in vacuum cleaners -  revs unto death if unloaded), parallel or some compound arrangement.  Consultation of dry and dusty tomes and manufacturers' spec sheets  recommended if ever considering PWMing "real" motors. 
** Some controllers determine rotor position from back-emf on windings and other esoteric schemes may exist. Hall sensors seem to be a common solution.