Some kinds of trauma can cause pain so severe that it makes you unable to move or do anything at all. It may put you out of action and unable to help yourself because of how excruciating it is.
Although I understand that pain is necessary to alert the brain that something is wrong and need to be fixed, I imagine it like an alarm going off alerting about trauma. But a crippling pain would be like a deafening siren hooked up to your ear making you unable to do anything to correct the problem, instead it might send you into a shock. It would be total disaster which could prevent you from taking any step about it. So, why does excruciating pain exist? Or in other words, why has this feature not gone extinct during the course of evolution in spite of its harmful effects?