Let’s start with the basics of batteries. A Galvanic Cell (a single battery is composed of one or more such cells) consists of two DIFFERENT materials (usually metals) called the electrodes both immersed in a (normally liquid) solution called the electrolyte. The electrolyte has dissolved in it chemicals related to the two electrodes, and these are dissociated into ions. The ions can move around in the electrolyte, and thus can carry a current from one electrode to another. In many sealed batteries the electrolyte also has added to it something to make it semi-solid or paste-like so that it won’t flow easily mechanically and leak, even though the ions in it can still move quickly. In some designs there is also some inert matrix material (like a glass fibre mat) soaked with the electrolyte and holding it in place to keep it from moving. The battery stores energy as a mixture of CHEMICALS that can change during use or recharging – it does not store energy as electrical charges.
Each electrode has an external connector or terminal. When the battery is first assembled the components reach an equilibrium condition in which the two electrodes are at different electrical potentials, so there is a voltage across the battery terminals. As long as nothing is attached to those terminals to allow current to flow, nothing changes and the battery remains “charged”. (Well, actually, it will slowly degrade and lose change (voltage decreases) due to minor side reactions, but ideally this is a very slow process.)
Things change when a current path (an electrical load) is attached to the terminals. At the CATHODE, metal atoms release one or more electrons (chemists call this oxidation of the metal) each, producing positive ions of that metal that dissolve and leave into the electrolyte solution. This leaves behind excess electrons that can flow out of the Cathode terminal and through the external load to the other terminal. Meanwhile, at the surface of the ANODE, ions of its metal approaching from the electrolyte accept electrons from the Anode to convert them into metal that deposits on the Anode (Chemists call this reduction). To the external circuit, electrons are flowing through it and electrical energy is being used. Inside the battery cell, two types of chemical reactions are occurring – oxidation and reduction. The net result is that metal from the Cathode is being converted into ions of that metal and released into the electrolyte, while ions of the Anode’s metal are being removed from the electrolyte and deposited as metal onto the Anode. This alters the original balance of concentrations of the two metal ions in the electrolyte solution. The result is that the battery voltage slowly decreases until it gets too low to serve the needs of the external load.
In theory, the two chemical reactions involved can be reversed. If you use an external source of electrical power and apply to the terminals of the battery a voltage that is opposite in direction to the battery’s normal voltage and slightly larger, you can force current to run backwards through the battery. This means that each of the two chemical reactions at the electrode terminals are forced to go in reverse, thus pushing the balance of metal ions in the electrolyte solution back to its original starting point. This is how you recharge the battery. In some types of cells this is not practical to do because of excess heat or production of gases, and that type of battery is called “disposable”. For example, trying to recharge a common Carbon-Zinc sealed flashlight battery will cause it to crack open the zinc outer can and leak electrolyte paste, so it should never be done. But there are many battery types that CAN be recharged in this manner. Common examples are automobile Lead acid batteries and Nickel- Cadmium or Nickel-Metal Hydride batteries in electronic devices.
There are two vitally important issues in recharging batteries designed for that use. The first is the actual voltage. The charging circuit must supply a higher voltage than the current battery voltage in order to force a current to flow through. However, once the battery is returned to its fully-charged design state, the charging circuit must NOT supply a higher voltage and try to keep overcharging. Now, every battery design has a specific voltage at full charge, so the battery charger used must be designed for that battery type to make sure its voltage is set correctly. Secondly, some battery types can be charged more efficiently, and with less risk of internal damage, if the charging current is carefully regulated. In fact, some systems require different current at different stages of recharging. So again, a good charger is customized for the specific battery it is intended for.
In electrochemistry there is a famous mathematical model, called the Nernst Equation, which relates the Free Energy of the chemical reactions involved in a particular cell, the concentrations of its components, the battery temperature, and the voltage you get as a result at the battery terminals. For practical purposes, it shows two important characteristics of all batteries. One is that as component concentrations change the output voltage changes, as discussed above. The other is that output voltage will decrease as battery temperature drops. Ask any hardy northerner about the problems trying to start a car at 35 below!