Glenn Fleishman’s most recent books include Take Control of iOS and iPadOS Privacy and Security, Take Control of Calendar and Reminders, and Take Control of Securing Your Mac. In his spare time, he writes about printing and type history. He’s a senior contributor to Macworld, where he writes Mac 911.
You can try several tricks to see if it’s a problem in how your iPhone decides to charge or in how it measures the battery’s fully empty state. Failing that, get a new battery.