What is the condition of the battery?
From the batt icon in the upper right menu bar, click open holding the option key.
Anything but Condition = Normal needs to be replaced.
About Mac notebook batteries - Apple Support
https://support.apple.com/en-us/HT204054
Determine battery cycle count for Mac notebooks - Apple Support
https://support.apple.com/en-us/HT201585
Batteries - Maximizing Performance - Apple
https://www.apple.com/batteries/maximizing-performance/
Apple Portables: Troubleshooting MagSafe adapters
https://support.apple.com/en-us/HT203207
In or out of warranty you can get a free over the counter 'Apple Service Diagnostics' test /assessment
Make an appointment for a "hardware issue"—
https://www.apple.com/retail/geniusbar/
Outside the USA
https://locate.apple.com/country