My 2008 MacBook Pro was able to detect battery problems one year before they started to manifest physically. They did it by adding another controller and an independent firmware to the battery itself, but there was no better tech at that time.
M powered MacBooks added auto hold-off (discharge to 80%, keep it there) or postpone charge (because the battery is used too rarely), to the list of tricks they know, and these are just the visible ones to the user.