A battery charger stores chemical energy into a battery by forcing electrical current through it, reversing the chemical reactions that produce energy. In an exact reversal of the discharge process, a battery charger makes the cathode undergo oxidation, which consumes electrons (electricity). Meanwhile, the anode undergoes a reduction reaction. This "resets" the battery, so that it can again release energy when needed.
Different batteries require different voltage, amperage, and wattage, depending on the battery design, components, and size. A small "AA" cell battery, for example, will only have the ability to release about 1.2 volts, when fully charged, and should therefore be charged with a similar voltage. Attaching a car battery charger and forcing 12 volts through that small battery would at best damage the battery, and a worst cause damage to its surroundings as well. Therefore, a variety of battery chargers exist, for the various different kinds of rechargeable batteries.