I think it's multifaceted. My first clear memory of being suicidal was when I was about 9 years old, but that's my first *clear* memory. I was probably suicidal even before then.
I was raised in a household where I had my basic needs met, but I don't think I did emotionally. My parents got divorced when I was young, I have a complicated relationship with both of my parents. I haven't told either of them that I love them in years. My therapist as a child told me she thought I had depression - last year I went to the doctor because I needed a form filled out for work with my medical history and my family doc put that I had depression on it, so I think I was officially diagnosed and just too young to fully comprehend what was going on. Since then I've had some psychologically inclined friends tell me that they think it's possible I have BPD, PTSD, BD, or other conditions. Essentially my mental health has never been the best. Outwardly I think I'm quite high functioning, but inside I've felt sad and unfulfilled as long as I could remember.
Only time I was happy in my life was just under a two year period that I was in a relationship, but my boyfriend left me eventually. He said that it wasn't my fault, he liked me, and later he even said he regretted doing it but by that point my mental health had deteriorated to a point that he didn't want to be with me and even I knew I couldn't be a good partner. I begged and pleaded for him to tell me what I did wrong if he really felt he had no reason to leave me and he hasn't really every told me. When he broke up with me he told me he was bored of me and that I didn't excite him but he's now invalidated all of that and said that I never bored him. It's all left me quite confused and scared.
Anyways, I just generally feel shitty all the time. I was briefly happy but I've never been able to sustain a healthy social life and I thought maybe my relationship would be an exception to that but it wasn't. I have no friends. Barely talk to my family anymore. I used to like my job but I honestly have no interest in it now. Everyone tells me "try reconnecting with hobbies" but I've done that. Gone to concert, tried getting back into gaming, exercise, going on walks, nothing works. In the fall I would go for walks at night on hiking trails near my house and I honestly feel like those "mental health walks" would just make me feel worse. I feel like I would enter a delirious state and just end up wandering through the forest for hours on the verge of tears, feeling like the world is spinning around me, tilting back and forth like a boat on the ocean, or that the canopy of trees was leaning over me and about to close/trap me in and kill me like a venus fly trap. I've never had delusions like that before, but I've started having them recently. A few weeks ago I also had a delusion where my phone (which is usually empty) all of a sudden had those notification bubbles (the ones with numbers) counting up the hundreds on every app, even shit like the settings app or calculator. It made me feel irrationally overwhelmed like the world was ending and I had to go hide in my blanket in bed and cry. Usually afterwards I can realize that it's fake and dumb, but in the moment it always feels super real. For the longest time I reasoned with myself that I wasn't "that bad" because it never affected my work but even that has become debatable. I often feel irritable or on-edge, and sometimes I find myself feeling pressure in my chest and angry towards patients in a way I didn't before.
All of this is to say, I'm getting worse in pretty much every aspect of life. Other than my cat I don't really have anything I care about. I don't really have anything I look forward to either in the short term or long term. The main things keeping me alive are fear of pain and death and guilt surrounding how people will feel. But if I was given the opportunity to just die spontaneously, I would take it.