Anon, sometimes depression can have an external source - like a traumatic event or a particular situation. It would be extremely narrow minded to believe that just because Robin Williams experienced great success that he would somehow be spared experiencing a traumatic event that could trigger depression. These events can happen to anyone.
More times than not though, depression has no specific trigger at all. In most cases it begins (like most mental illness) in adolescence, symptoms begin to appear in late adolescence or during a person's 20's and can continue for a life time. And like most mental illness, it has no 'trigger' or 'reason' or specific 'starting point.'
It's very likely that Williams developed depression long before he was rich and famous. It actually has absolutely nothing to do with him having "everything he ever wanted and needed" like you said in your original post. Having 'everything' isn't going to cure cancer and it isn't going to cure depression. It is much more complicated than that and superficial things like nice houses, cars, money in the bank or whatever is not going to cure someone from depression or insulate/protect someone from developing it.