It’s based on a certain number of charge “cycles” and not necessarily actual remaining capacity. When I was working as a “Genius” equivalent for an Apple reseller about five years back the number of cycles before that warning would pop up was around 500.
500 seems like a fairly low number to me, I'm surprised it's not more like 1000.