The battery management hardware/firmware takes care of the Li-Ion batteries. To extend life, the algorithm won't continue to charge the batteries after they are fully charged. Instead, it lets the batteries back down to maybe 96% SOC (State Of Charge) before charging again.
The charge algorithm is basicly CC-CV - Constant Current-Constant Voltage. The batteries charge at a constant current until they reach a certain voltage (around 4.1V/Cell). Then the current tapers down to maintain this voltage (constant voltage) until they are fully charged. An "Electronic Fuel Gauge" gathers data from the performance of the battery in an attempt to accurately estimate the SOC and thus the remaining charge/runtime.
Rob