To me , the act of harming oneself is a way to redirect attention.
The pain immediately overrides other discomfort in the mind. Also the physical pain is predictable, whereas the psychic pain is generally chaotic and therefore more distressing.
It is intense, and then begins to fade providing a sense of increased wellbeing.
I believe that this is also related to what might be called the ascetic impulse, which motivates a lot of religious practices, especially those that might be considered penitent.
I was always fascinated with this concept of self-mortification from an early age when I had no name for it. It is so uniquely human. I believe there is probably some relation between the unique structure of the brain in AS and those parts of the brain which are responsible for such uniquely human characteristics.
When I was a child, I purposefully cut my fingers a few times, when I was depressed.
Later when I was in my early twenties, I burned my arm pretty severely. The scar serves as a reminder that I do not want to do that sort of thing again.
_________________
"I was made to love magic, all its wonder to know, but you all lost that magic many many years ago."
N Drake