Re: "To provide a better experience to customers"
What's preferable, phone unexpectedly shutting down without warning, or phone slowing down to avoid sudden shutdown?
The big issue is of course that the user wasn't notified in either case, on any brand of phone (androids also suffer from thus when their battery gets old, sudden shutdowns despite having 30% left).
On the other hand, it's not an easy problem to solve. Unexpected shutdown means unexpected, even if there was an algorithm trying to collect data about the operating state of the cpu and all its peripherals, and recording battery voltages, when unexpected shutdown hits you lose the data. The hardware shuts down to protect both the battery (since they become unstable from operating at low voltage) and the CPU, ram and storage from corrupting data due to insufficient voltage.
AMD have a "clock stretching" feature in some of their CPUs, if the voltage inside the CPU drops the frequency slows down. It's mostly meant to allow them to operate with lower voltages and save power by not needing as big "safety margin" in voltage. Would be interesting to see something similar in mobile SOCs!
It's kinda remarkable that battery meters are still so bad at tracking the capabilities of an aging battery. On one hand, it's a kinda neglected area where manufacturers choose the cheapest component. On the other hand, it's a difficult problem! Batteries aged in standard cycle testing behave differently to batteries aged in real life. Batteries in real life age differently depending on how they're used and charged.
What do I mean by aged differently? As is well known, a battery's voltage sags when you put a load on it. The bigger the load, the more the voltage drops. The amount of drop is, for most part, a linear function of the load. When the battery is new, the sag is so small it makes no difference. The amount of sag can be described as internal resistance. More internal resistance means more sag.
On a new battery, the internal resistance stays nearly constant regardless if the battery is 100% or 20% full. Towards empty it becomes a bit higher. With an ideally cycled and aged battery, the capacity is lower, and the internal resistance is higher, but the internal resistance is still around the same order of magnitude regardless the battery is full or empty.
With batteries aged in real life conditions, where the battery might've spent a lot of time at 100%, a lot of time at 0%, a lot of time in heat, etc, the results on internal resistance will be different. The internal resistance might sharply rise as the battery discharges. From the initial situation with a fresh battery having a flat internal resistance curve vs state of charge, to having a inclined straight line describing an increased resistance at empty, to having exponentially increasing resistance towards empty.
Why does this all matter? Because currently there's no battery meter chip that can take into account anything except the "internal resistance is the same regardless of how full battery is" situation. Most chips don't account for internal resistance at all.
So from an engineer's perspective, if Apple is actually tracking actual battery performance and managing to make their system adapt to having a smaller and smaller power budget, that's kinda impressive. Makes me glad someone is finally paying attention to adding more sophistication to battery management systems!
Of course, they could just have put in a battery twice as big and they wouldn't have had issues with shrinking power budget for the phone's "lifetime", and they wouldn't need to consider aging battery.