Three dimensions of pain
In 1968 Ronald Melzack and Kenneth Casey described chronic pain in terms of its three dimensions:

"sensory-discriminative" (sense of the intensity, location, quality and duration of the pain),
"affective-motivational" (unpleasantness and urge to escape the unpleasantness), and
"cognitive-evaluative" (cognitions such as appraisal, cultural values, distraction and hypnotic suggestion).They theorized that pain intensity (the sensory discriminative dimension) and unpleasantness (the affective-motivational dimension) are not simply determined by the magnitude of the painful stimulus, but "higher" cognitive activities can influence perceived intensity and unpleasantness. Cognitive activities may affect both sensory and affective experience or they may modify primarily the affective-motivational dimension. Thus, excitement in games or war appears to block both the sensory-discriminative and affective-motivational dimensions of pain, while suggestion and placebos may modulate only the affective-motivational dimension and leave the sensory-discriminative dimension relatively undisturbed. (p. 432) The paper ends with a call to action: "Pain can be treated not only by trying to cut down the sensory input by anesthetic block, surgical intervention and the like, but also by influencing the motivational-affective and cognitive factors as well." (p. 435)

Evolutionary and behavioral role
Pain is part of the bodys defense system, producing a reflexive retraction from the painful stimulus, and tendencies to protect the affected body part while it heals, and avoid that harmful situation in the future. It is an important part of animal life, vital to healthy survival.
Torture as a means to punish the citizen has been reserved for offences posing severe threat to the social fabric (for example, treason).The administration of torture on bodies othered by the cultural narrative, those observed as not full members of society : 101–121[AD1]  met a resurgence in the 20th century, possibly due to the heightened warfare. : 101–121[AD2] Many cultures use painful ritual practices as a catalyst for psychological transformation. The use of pain to transition to a cleansed and purified state is seen in Catholic self-flagellation practices, or personal catharsis in neo-primitive body suspension experiences.Beliefs about pain play an important role in sporting cultures. Pain may be viewed positively, exemplified by the no pain, no gain attitude, with pain seen as an essential part of training. Sporting culture tends to normalise experiences of pain and injury and celebrate athletes who play hurt.Pain has psychological, social, and physical dimensions, and is greatly influenced by cultural factors. Non-humans
René Descartes argued that animals lack consciousness and therefore do not experience pain and suffering in the way that humans do. Bernard Rollin of Colorado State University, the principal author of two U.S. federal laws regulating pain relief for animals, wrote that researchers remained unsure into the 1980s as to whether animals experience pain, and that veterinarians trained in the U.S. before 1989 were simply taught to ignore animal pain. The ability of invertebrate species of animals, such as insects, to feel pain and suffering is unclear.Specialists believe that all vertebrates can feel pain, and that certain invertebrates, like the octopus, may also.