I´ve been a cutter in my teens (and tweens as well) and did for two main reasons. One was unbearable emotional pain, when the inner pain was so much, that I could not tolerate it at all any more, so what I did was something like "making the pain physical", it calmed me down, and made the inner pain get better. It worked basically like a sedative for me, and is was, in fact, a way to not do anything worse.
At other times I had this intense feeling of having lost myself, like not being grounded to the earth below me anymore, it is difficult to explain how that feels, it´s called dissociation, and that was very frightening, like I was loosing myself and going mad. In this situations intense physical stimulation, like the pain caused by the knife was "bringing me back to earth".
The pain does release hormones which work like sedatives.
I never selfharmed to gain attention, or threaten anybody or as a failed suicide attempt.
Actually, I am now a doctor, a pediatrician, have two kids waiting for the third. I still have the scars, and I do not cover them up, since this was such a big part of my biography, and maybe made me to the person I am now. I even tell people what they are from if they ask, and if I know them at least a bit. Obviously not the little patients :)
There is a wealth of information online, http://www.selfinjury.org/indexnet.html might be a starting point for you.
Good luck! And it is really nice to see that you actually care about that girl, that is really rare.
Feel free to ask questions, if I can help you, I will!
Follow Mothering