Check the Battery Health on the iPhone as follows:
Home Screen > Settings > Battery > Battery Health
If the Battery Health is less than around 80%, you need to replace the battery.
iPhone Battery & Power Repair - Apple SupportOfficial Apple Support › iphone › repair › service
If the Battery Health checks out OK, best to take the iPhone and charger in to an Apple Store or Apple Servicer to let them take a look.