You also generate heat in batteries while charging and discharging them. The greater the current going through them, the more its internal temperature rises. (I have a charger that sends 100 mA through AA, C, D size, and it makes them noticeably warm.)
You can only take it so far, so you should stop charging when the battery is full. A full battery starts to generate more heat because it no longer converts electrical energy to electrochemical storage.
Therefore this method requires a careful schedule of heating a resistive load with the aid of the batteries, then charging them to generate heat in them.