What biological function results from cutting oneself that makes the cutter feel better?

Cut to feel better? For some it can make real the pain they feel internally - pain they cannot put words to. The cutting also can be with the expectation that the pain or anguish will abate or end with the action. There has been suggestion that endorphins are released - causing the temporary calming that allegedly follows. Naltrexone has not been that promising though in controlling self-injurious acts.
Self-mutilation. Because self-injury is often done on impulse, it may be considered an impulse-control behavior problem. Self-injury may accompany a variety of mental illnesses, such as depression, eating disorders and borderline personality disorder.
Distraction. Frequently cutters say that the pain of cutting helps return them to reality and distracts them from the chaos inside. Get therapy.