The actual capacity of a battery decreases as the battery ages through an irreversible fading process. This capacity loss occurs both with active use, correlated with charging cycles, and with inactivity through self-discharge. The device may even come with substandard batteries. However, the amount of loss is linear with time and accelerates with increasing temperature. Smartphones do not typically employ sophisticated techniques for estimating the usable capacity with the basic solution basing on simple charge cycle estimation and then using an offline calibrated lookup table to find the state of charge or battery level given the charge cycle.
Battery level or State of Charge (SOC) estimation in modern smartphones cannot capture the usable capacity of the battery run time, and thus have unreliable SOC estimation. This inaccuracy manifests as sudden jumps in the battery level, and can result in unexpected shutdown of the device.
Therefore, there are two issues; (1) The battery capacity is reduced, and (ii) The device is unable to estimate the capacity loss. The detail about this can be found in the following paper.
Page on acm.org Sudden Drop in the Battery Level? Understanding Smartphone State of Charge Anomaly.
This is a weird behavior I have noticed on my iPhone 5 since I upgraded to iOS 8.
My iPhone 5 will get stuck on 61% battery for 15 minutes and then jump down to 59%. When the battery was at 45%, I used the camera for maybe 30 seconds and then all the sudden the battery dropped down to 39%.
Another time it was at 5% for almost 40 minutes and then went down to 4% continuing to do so.