Social media is about conversations, community, connecting with the audience and building relationships.
It could be both, maybe they hurt themselves because they want to call some attention or it could also be their way to feel better with themselves