At first pain has the purpose of warning the person. It protects us from further injury or harm. The body is saying, "Stop whatever you are doing -- it hurts." Escape is the next step: get away from whatever is causing the pain. This is also a protective mechanism.
Expressions of pain (facial or verbal cues) are a way to seek help. They also have the effect of causing empathy on the part of others. Our own distress in seeing someone in pain motivates us to help or assist that person. Pain helps the sufferer get the care he or she needs.
If the pain signals are not turned off early on, they can get stuck. Someone with chronic pain that doesn't go away may not have anything wrong biologically. The pain system has set up a circuit or loop that can't get turned off. The natural purpose for pain has been overridden.
In some people there may be a psychologic or emotional need for pain. This type of pain is called a behavioral response. The traditional medical model of treatment may not help this person. Until we learn how to stop chronic pain, treatment has become a management issue. We help the patient do more within the confines of their pain. Pain may be reduced but not eliminated.