When I was younger a lot of people I knew had issues with self-mutilation. They all had a lot of family issues, most of them either being largely ignored or verbally/emotionally abused by their parents. Cutting, for them, was a way to release their emotional pain in a physical way. Maybe, in those moments when the adrenaline from the pain kicked in, it masked all the emotional pain in their lives.
What often happened with the people I know is that they would become addicted to self-mutilation because of this feeling of release. That’s when it gets really bad: they can’t stop, because it’s the only way they feel they can deal with their problems, even if it is only a temporary solution.
There are also the people who try self-mutilation as an experimental thing, to see what it feels like. Often cutting and other forms of self-harm only become serious when the person’s emotional pain is so great that it outweighs the physical pain. People who usually do this indeed have mental illnesses that make it difficult to think clearly and realize that there are better ways of dealing with their pain.