Why are there 3 pins on some batteries?
The third pin is usually for an internal temperature sensor, to ensure safety during charging. Cheap knock-off batteries sometimes have a dummy sensor that returns a "temp OK" value regardless of actual temperature.
Some higher-end batteries have internal intelligence for charge control and status monitoring, in which case the third pin is for communications.