The hazards of congenital insensitivity to pain (CIP) are well-known.
This question is about the obverse: what selective advantage, if any, does the normal sensation of pain confer? I'm thinking of severe pain such as that associated with back injury, burns, and some intestinal problems in which the pain seems to serve no function other than to incapacitate.
A related question is whether there is a spectrum of sensitivity to pain, ranging from CIP to heightened sensitivity, what the distribution looks like, and whether this is a genetically plastic trait (like color perception)? If the distribution were sensitive to selective pressure then naively I would guess it serves our needs well, but we spend a lot of our collective time trying to dial it back, hence my question.