I'm sure the experience and the causes vary deeply from one person to the next. Here is a view that counterposes against the medical model that most of us have been exposed to.
Laura Delano was a highly successful student who got swallowed by the Harvard student health system, treated with a cocktail of different pharmaceuticals, as her ability to cope with daily life spiraled downward. Ten years later, she took it on herself to taper off her meds, and endured a year and a half of even worse pain and new symptoms. Then she began to heal. She now runs The Inner Compass, an community to support people looking for alternatives to medical treatment.
In this interview, she talks to Charles Eisenstein. Their thesis, in a nutshell, is that many problems identified as psychological actually derive from a mismatch between a person's deep sensitivity about what it is to be human and the expectations of their social environment. They go on to describe ways in which treating the issue as biochemical invalidates the patient's experience, and sometime can worsen or at least complicate the issue with the message "there's something wrong with you." Charles and Laura (I agree) cite evidence that data reported in medical journals about the effectiveness of antidepressants are distorted by economic interests, and that alternatives to pharmacology are not compared on a level playing field.
There's a segment at the end where Charles asks Laura, "What would you say if you could go back and talk to your 13-year-old self?" Laura responds:
"Trust. I'd say, What you're feeling and thinking, this terror and confusion that you're grappling with -- trust that this is happening for a very important reason. And if you listen to it and have the courage to stay with it, it's going to lead you closer and deeper into who you really are. The fact that you don't know who you are right now, the fact that you want to die and that you are debilitated by those racing thoughts, the urge to channel your pain into hurting yourself -- It's not because there's something wrong with you; it's because you're awake and you're feeling the pain of the world around you. Don't let them tell you you're broken. Don't let them tell you your pain is a sign of sickness. It's really a sign of your aliveness.
"And I'd also say: You are so far from alone. At the time, I was convinced I was the only one going through this. I had no idea that there were so many people experiencing something, if not the same, at least akin to what I was feeling."