How is battery health determined?

In the KDE battery display I notice the battery health statistic is displayed at 82%.

Running standard MacOS in System Settings gives the battery helath at 90% last time I checked.
What acounts for the difference between those two figures, and how are they determined?

This app (free version)

gives the same health level for the battery under macOS as Asahi does.

With Asahi Linux the value is read at the system level (I’am at work without my Apple M1)

It’s capacity / design capacity as far as I know. I’m not sure what macOS does, maybe it has a fudge factor?