I've heard this sort of self harm somehow focuses the hurt elsewhere, but then I've also heard that people who are that distressed don't even feel it when they cut.
It doesn't hurt when you do it but the ache afterwards helps you focus on something else.