Its a complicated question and i suppose the honest answer is that it will vary greatly dependent on the person but I'll tel you a story.
About 10 years ago my best friend and i shared and apartment together. We were like two peas in the same pod. We had very similar interests, we laughed at the same things and people would generally joke about how you wouldn't see one of us without the other.At the time we both did the same job but in different sites, we drank a lot and went to parties and generally did the silly things that young people do in my city. We'd go to work, work a long shift then come home and someone would go to buy beer or wine or whatever and we'd get silly. This started happening every night. At the time i didn't know this but this was something new for me but for my friend it wasn't. He'd been living like this for years (he was a good bit older than me) I'm not proud of this but t started to bleed into our days as well, we'd be hungover at work, we'd fall asleep on the toilet and because we were going to bars and buying alcohol every day we were steadily getting into debt. Our bosses started to notice. Now here's the fork. My boss pulled me aside and warned me that if i didn't start behaving i'd be in real trouble, His boss did nothing. I started trying to be on time he continued getting drunk every day. I'm not saying i was an angel but i got it under control a bit better. The money (or lack of it at this stage) forced us to move out of our flat. I moved in with my parents he got a shitty boxroom in an apartment with a bunch of 'likeminded' people. I started doing pretty good at work. He got sacked. I tried so many times to talk to him but he'd just laugh it off and tell me not to be a p**sy. Eventually we kind of grew apart as people do. the spiral was ongoing for him and a few months later, Drunk, out of money, bereft of any ideas of how to better his situation my friend jumped in front of a train and died instantly.
I often wonder what would have happened if we had each other bosses. would i be on the same downward spiral as him? would i e a stronger person? was there something in him that predisposed him to this that i didn't have or would i have ended up on that train platform drunk and alone that same night.
I know it doesn't answer your question as such but I've thought about what drives a person to take his own life a lot. I think that every person has a breaking point, and that point is different for everybody. Mental illness can obviously play a significant role but i don't think that every person who tries to take their own life is suffering from mental illness. The mind is a complicated and largely misunderstood thing the sad thing is i think most of us wont ever think we could get to that point until it is already upon us but the good thing is that i believe that if you keep your faith things will get better and that an understanding of the lows can make you truly appreciate the highs of life. As for my friend? I think he made a drunken mistake. I don't think he would have done it if he hadn't been drunk that night.