Suicide is more often than not irrational. I would argue that terminal patients have just cause, but that's another story altogether.
Suicide is rarely spontaneous if by spontaneous you mean the thought had never occurred prior to the moment a person decides to kill themselves.
I know several people who have comitted suicide, probably 20 or so. I have spoken with hundreds who have made the attempt, from feeble to serious. All part of dealing with addictive personalities. I myself have had a gun at my head, many moons ago. Barrel on the temple, slack out of the trigger. Drink in one hand, gun in the other. Not a good combo.
I can tell you from my own experience, and from many conversations, suicide is usaully a long time in the works and eventually the person believes that the pain in which they are suffering will never end. In simpler terms, they lose all hope of ever seeing a brighter day. It's a darkness of which I would wish on no man.
There are of course other types of suicide. Those that are not wanting to face the consequences of some horrible action they just took. Some crazy thought of punishing someone that you feel has done you wrong. The old, I'm mad at you so I'll kill myself routine. In the end, it's a very permanent solution to a temporary problem.
So you may be asking, why didn't the good old Captain off himself? At the moment it was happening I had a thought. Being a atheist at the time my intial thought was fuck it, what's done is done. I had another thought right after that. What if? That question saved my life. Things can and do change. People can and do change.