Current always flows from a higher potential to a lower potential. So, the normal course of current flow is:
However, while charging, it is necessary to flow the current in the opposite direction through the battery so that the chemical reactions opposite to those in discharging (normal current flow) takes place. In order to do so, we have to provide a potential difference higher than that between the plates of the emf as shown in the following diagram:
Emf
Charger
When the internal resistance is drawn and Loop law is applied, we get the following diagram and equation:
emf , int. resist
Charger(V)
E + ir -V = 0
The rest is same as Raman sir's