When over time and in an unrelenting way you feel utterly alone and feel that you and your life don't matter, death becomes you.
Robin Williams did not die from depression. There are tens to hundreds of millions of depressed people who do not commit suicide.
What he died from was des-pair* (possibly the most life threatening part of depression).
And by des-pair I mean feeling utterly unpaired with many of the things that keep us going:
1. Hopeless - unpaired with a future that was worth living
2. Worthless - unpaired with any things you could do to take away some core feeling of worthlessness
3. Useless - unpaired with feeling you helped the world and/or unpaired with any lasting treatment that would take away your despair
4. Helpless - unpaired with feeling there was anything you could do to make yourself feel better in a lasting fashion
5. Meaningless - unpaired with feeling that anything you did mattered
6. Purposeless - unpaired with anything other than making other people laugh which wasn't enough
7. Pointless - unpaired with feeling there was any reason to go on given the above
And if you're feeling many or most of the above, it is very tempting to pair with death as a way out of your suffering. That is because when the above have become all of you, the only way to make it all go away is to make you go away.
Now of course most of us (who don't know how dark and deep depression can be) would find it hard to believe that he could feel any of the above much less most of the above. And that is precisely what causes a person to feel alone in their pain.
Pain is pain, suffering is feeling utterly alone in pain. Most people can endure chronic pain, few can endure prolonged unrelenting suffering. However when someone is able to make it through and pierce your "iron dome" that keeps all help and hope out and keeps you locked up inside, suffering you can't live with becomes pain that you can.
Rest in peace Robin Williams, we hardly knew yee... at least not the part of you living -- and dying -- inside the laughter.
Perhaps if we had, you might have felt less alone, less unpaired with anything other than death to relieve you and would be continuing to make us laugh instead of causing us to cry with too late empathy for the true suffering you have been living with until you could live with it no longer.
* It is of course presumptuous to assume the above without having examined Robin Williams. However as a suicide specialist for more than thirty years I can say that one thing that nearly all suicidal people felt at the the point of making an attempt was a feeling of despair. The purpose of the above is to use it to have conversations with people that you worry might be feeling suicidal and then when they speak to you, "just listen." If you can do it in a way where they not only feel understood, but also "feel felt" by you, a number of them may give up their suicidality. That is because if they feel felt by you, they may not need to move toward suicide as the only thing that "understands" their need to end their pain. A resource that might also help is: What Your Teenager Wants You To Know, But Won't Tell You.