Chargers for NiMH and especially Lithium Ion batteries regulate the charging current and will stop charging the batteries once they reach full charge. In a computer, the battery itself has a controller to disconnect the charging current once the battery has reached full charge. I’ve noticed that the charger for my Makita power drill will allow the battery that’s sitting in it to self discharge if I leave it in there for a long time; NiMHs self discharge over a period of weeks. I have to pull the battery out and re-insert it to get the charger to reset itself. Some power tools continue to use NiCds for that reason.
Lead-acid and NiCd batteries can be charged with just about anything that has an open circuit voltage greater than the open circuit voltage of the battery when it’s fully charged. Just a transformer and a diode will do, However, both types of batteries can be overcharged in this fashion, so you want to monitor how long you’ve charged them.
NiCds develop a memory effect. Other types of rechargeable batteries don’t; however, most should not be deep discharged unless they’re rated for it. Fully discharging a Lithium Ion battery can flat-out kill it. Lead-acid cells recover from deep discharge, but it shortens their lives. NiCds, on the other hand, need to be fully discharged periodically to remain healthy.