4 pins are usually PWM fans which have an extra control wire that works with circuitry on the fan to switch the fan on and off 25,000 times per second to regulate fan speed.
3 pin fans are much simpler and require voltage control to slow them down. They still have some circuitry on board the fan but they are much simpler than PWM fans.
The first wire is ground, the second power, the third is the tach feedback wire and the fourth is a 5v PWM signal wire.