Well, the short answer is that they don't! In the initial stages of dilation, a doctor, nurse or midwife will feel the opening in the cervix, and tell you the approximate diameter of that hole. So from 1-4 or 5 centimeters, they are actually measuring it just how you would imagine.
But from 5 or 6 centimeters until 10 centimeters, what they are really measuring is how much cervix is left, and then subtracting from 10. So an "8" doesn't necessarily mean that there is a hole that is exactly 8 centimeters in diameter, it means the care-provider feels approximately 2 more centimeters of cervix remains. Many women do not dilate in a perfect circle. Often times, the cervix will dilate in an oval shape, or a pear shape (that's what causes the famous "anterior lip," which is a subject for another post) and the care-provider will round or guesstimate when assessing dilation.
Most moms are taught that 10 is the magic number, and are then confused when alternate terms are used. Personally, my favorite term is "complete" because it is accurate and hard to misunderstand. But recently, I have heard several doctors or nurses tell a woman that her cervix is "gone" or that there is "no cervix left" which can be very confusing! Most people associate the word "gone" or "no" with the number zero, which can feel to the woman like she has gone backwards. She wonders, "Wait, if I was 6 centimeters at my last exam and now they are saying there is no cervix, what does that mean? Have I gone back down to a 0?"
She is waiting to hear that magic number 10, which many care-providers never use because it is an arbitrary made-up number. Some women will be complete with a "hole" that is only 8 centimeters in diameter, others will dilate to 11 or more!
Remember, "10 centimeters" and "complete" both mean that there is no more cervix blocking the baby's exit. Often all the care-provider will feel at this last exam is the baby's head. So if your doctor tells you your cervix is gone, now you know that's a good thing!