My DD has anxiety, depression, possible ED and has self harmed. We're also going through school refusal atm.
On the one hand social media did contribute to the start of it. She was bullied very badly, both in school, outside of school in the park etc and on social media. When I removed her from social media she felt she was being punished for being the victim of bullying.
Of course, without social media the bullying still would have happened but she would have had an escape from it at home.
On the other hand, social media has been invaluable when dealing with what she is feeling. She is able to follow vlogs and youtubers who talk about depression, self harm, bullying etc and their experience of it and know that she is not alone in what she is feeling.
She's also through commenting on these vlogs etc made a good, supportive group of online friends. They have a private group chat going where they cheer on each others successes and support each other through failures (and help out with the 'likes' issue by liking each others posts)
Her bio dad also had depression and suffered from alcohol abuse, so I think it's genetic and maybe exacerbated by tech in DD's case.