Apple 5s changed from 6 1% to 57% in the blink of an eye. What happened?

The system estimates the battery charge according to the fluctuation of power supply voltage and current, but this is not necessarily accurate. When the battery is aging, the voltage sometimes becomes unstable, resulting in a sudden drop in the displayed power, and a sudden increase in the displayed power after the charger is plugged in. My 5s has been used for two years, and sometimes when it drops by 20%, it suddenly turns off because of insufficient power.