Scratching is an erotic activity that's most often done by women, but is enjoyed by both sexes. It can heighten the intensity of an encounter and feel like a naughty way to leave your mark on a hot partner. Since nerve-endings are being affected, the feeling can increase sexual pleasure, but of course it can also cause injury. It’s often a part of BDSM play, and should happen with the same level of consent as other acts.
You might think scratching is always deliberate, or some kind of unspoken release of aggression, but often women can scratch a partner just because they're convulsing in such an intense orgasm that even their fingers lose control. It’s most likely to hurt if she’s grabbing on too hard, so the partner needs to speak up if they find this unpleasant. The position can be changed or her hands can be repositioned to avoid any unpleasantness.
Dig your nails in and read more about how sweet pain can be: BDSM