It's counter-intuitive that hurting oneself could make a person feel better but, based on the assumption that no one truly wants to hurt themselves without a benefit, researchers have taken reports from people who compulsively harm themselves and sought a way where cutting or burning could provide relief from emotional distress. 

Individuals with borderline personality disorder experience intense emotions and often show a deficiency of emotion regulation skills. This group also displays high prevalence rates of self-injurious behavior, which they claim helps them to reduce negative emotional states.

Inga Niedtfeld and colleagues studied the effects of emotional stimuli and a thermal stimulus in people either with or without borderline personality disorder. They conducted an imaging study using picture stimuli to induce negative, positive, or neutral affect and thermal stimuli to induce heat pain or warmth perception. The painful heat stimuli were administered at an individually-set temperature threshold for each subject.

In patients with borderline personality disorder, they say they found evidence of heightened activation of limbic circuitry in response to pictures evocative of positive and negative emotions, consistent with their reported emotion regulation problems. Amygdala activation also correlated with self-reported deficits in emotion regulation. However, the thermal stimuli inhibited the activation of the amygdala in these patients and also in healthy controls, presumably suppressing emotional reactivity.

Dr. John Krystal, Editor of Biological Psychiatry, commented, "These data are consistent with the hypothesis that physically painful stimuli provide some relief from emotional distress for some patients with borderline personality disorder because they paradoxically inhibit brain regions involved in emotion. This process may help them to compensate for deficient emotional regulation mechanisms."

The authors note that these results are in line with previous findings on emotional hyperactivity in borderline personality disorder and suggest that these individuals process pain stimuli differently depending on their arousal status.

Citation: Inga Niedtfeld, Lars Schulze, Peter Kirsch, Sabine C. Herpertz, Martin Bohus, Christian Schmahl, 'Affect Regulation and Pain in Borderline Personality Disorder: A Possible Link to the Understanding of Self-Injury', Biological Psychiatry, Volume 68, Issue 4, 15 August 2010, Pages 383-391