The battery charge profile is predetermined by the battery manufacturer.
The battery charge control chips then implement that profile.
For example, see this datasheet for a LiPo charger
http://datasheets.maximintegrated.com/en/ds/MAX1811.pdf
It tests the charge condition of the battery, then charges at user selected current levels to user selected voltage level.
Not as well spelled out is how it knows when to stop charging:
"The MAX1811 is in current mode when the BATT voltage is below the regulation set point and in voltage mode when the BATT voltage is near the regulation set point."
I can only guess from this document that as the charge voltage is reached, it stops charging and tests to see if the voltage is being maintained.