It MOSTLY only worked with "official" batteries -- most of the third party ones didn't have the service mode EEPROM on their PCBs; it didn't keep you from using them and I've always been fairly confused why they left this mode in at all. Basically, you either flashed that chip (if you had another PSP that had CFW on it already) or removed the ground pin so it couldn't make a connection (if you were bootstrapping your first one) -- so when the microcontroller tries to read it, it just gets back a string of 1s instead of the actual serial number of the battery. If you booted a PSP off of one of these batteries (or even inserted it into a turned off PSP), it would start copying firmware files from the memory stick, and *bang* instant CFW PSP.
EDIT: This is a really old technique -- as far as I know it was patched in firmware 3.5, and only worked on original/first generation slim machines.