If the battery is not performing to your expectations, then check if the Battery condition is listed as "Service Recommended". If so, then the battery should be replaced since it is not performing to your expectations.
If the Battery condition is listed as "Normal" (or doesn't show any condition....implies "Normal") and the battery is three years old & not performing to your expectations, then it is still possible the battery may have a hardware issue. You can try running the Apple Diagnostics to see if any hardware issues are detected, however, this probably won't detect any issue if the Battery condition is "Normal", but it never hurts to try.
I have developed a method of testing my organization's batteries which otherwise appear "good" to macOS & Apple Diagnostics, but it is tricky to explain & interpret the results. You can see what the third party app Coconut Battery has to say about your battery's condition....I haven't used it enough on my organization's Macs to see if it reports issues when macOS says everything is "good". Unfortunately Apple won't use its status to confirm a battery only repair.
Hopefully the battery condition is "Service Recommended" so that Apple will easily replace it for you (for a fee), otherwise it can be hard to have Apple perform a battery only repair unless the service diagnostics report a problem since Apple techs are not trained to look closer at the battery to see some failures (Apple probably wouldn't allow them a battery only repair anyway since Apple has strict rules on it due to the battery being part of a much more expensive part).