I understand that the system can read the current voltage and determine battery remaining percentage from that. Say, if a Li-ion battery in a mobile phone is at 4.3V, it's likely the battery is full. This method is quite reliable even if the battery is worn-down, i.e. when it cannot generate as much power (Watts) as it could when it was brand new, but its voltage will remain mostly the same.
My question is, while voltage can be used to determine remaining percentage, how does the system give an accurate "estimated usage time" for a worn battery? Assume there's a device running at a precisely fixed power (e.g. 1.0W), and it's able to run for 6 hours on a half-charged (50%) new battery. When the same battery is half-worn out and also at 50% charge, the system can correctly estimate that the device can run for 3 hours. Consequently, the system is able to determine by how much the battery is worn out. How is that achieved?