Most phones do, to a certain extent. The percentage it gives you is just an estimate because you can’t really tell how much energy is in a battery until you discharge it all; you can only tell how much is going in and how much is going out, and make an educated guess from there. Generally, that guess is close enough to reality that it doesn’t make any real difference, so the percentage still serves its purpose. I’m grossly oversimplifying, but that’s the gist.
Most phones these days will usually only charge up to like 95% of the actual capacity of the battery, and will call that 100%.