Here...
It's wired up so that the charger charges the battery without the charge current entering the device, and so that the device is powered by the battery current, not the charge current. All this time it is monitoring the charge and discharge cut-off voltages.