A battery charger restores energy to a battery by converting alternating current (AC) from a power outlet into direct current (DC) of a higher voltage, forcing electrons back into the battery. It typically uses a transformer and rectifier to create this DC output, managed by smart electronics to prevent overcharging and overheating.