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.