At 20% or below, I lose battery power and the computer shuts down rather than waiting until 10% to deliver the usual low power warning
That behavior is typical of a faiing battery in spite of age. No home fixes. Have Apple evaluate as soon as possible.
The exception would be if you have inadvisedly loaded up your Macc with a bunch of unneeded utilities like anti-virus, so-called "cleaning" apps, or client-side VPNs. Those can mask real issues and create problems of their own.
If you are not sure what has been installed, and want a data-driven evaluation in this setting where we can neither see nor touch your computer, please post an EtreCheck report. We can quickly and within the limitations of these forums help you determine what issues are at play without our playing a protracted game of "20 Questions" with you that could go on for days.
EtreCheck Pro is available here:
https://etrecheck.com/index
The free version will do nicely for this purpose, although the app is worthy of our financial support.
We can see hard data about drive performance, software issues and interferences, and RAM usage. Etrecheck is the development of a long-serving and trusted ASC contributor. It is a reporting app, not a "fix-it” app, expressly for displaying information in these forums to help us help you remotely. It will not reveal any personal or secure information.
Please see this excellent user tip on how to post long text reports like EtreCheck's into a forum response:
How to use the Add Text Feature When Post… - Apple Community