Combination of genetics and conditioning...................if you are in excellent condition you can take punches much better, plus a strong neck helps................Watch Roberto Duran on the ropes, he knew how to move his head, I saw Duran work the speed bag with his head! Not joking! When Duran fought Hearns, he had only trained two weeks and had been partying, he was out of shape..................which makes a difference.................it's combination of things.
Think of a fighter's chin like a pinball machine. If it gets hit too hard, the machine/body goes into tilt.