Phone powers down prematurely

LG G5, about 2 years old.

Sometimes it spontaneously powers down, which it will do if the battery is too low. But as soon as I plug it in, the display will show anywhere from 15-20% battery (I would not expect it to power down until it is around 2%). If I turn it back on without plugging it in, sometimes it will just power back down, or sometimes come on but the battery runs down within a few minutes and it will power down.

Is this is symptom of an old battery? Faulty battery? Or the phone is not reading the battery correctly?

Had similar problems about a year ago with 2YO Samsung Galaxy S6. Battery capacity had dramatically decreased from new, and by that time, it would sometimes jump from indicating ~50% full to 1-2% full, and then powering down on its own. Replacing the battery solved the problem.