However, depression can occur in people with no family history of any form of mental illness. And I would be reluctant to suggest that there is any human who is entirely immune to depression under all possible conditions. Of course, people with severe depression are prone to astonishingly virulent and inappropriate guilt and self-hatred. In general, any life change, often caused by events beyond one's control, which damages the structure that gave life meaning. The ability of a person to respond to such an event will depend on many factors, including genetic predisposition, support from friends, physical health, even the weather.
Therapy can be immensely helpful here.
Obviously, not everyone to whom this sort of event happens becomes depressed, and not every person who becomes depressed has had this sort of catastrophe befall them. In fact, if a person suffers a loss and then becomes depressed, it may well be that they weathered the loss in fine style and then succumbed to a much less obvious trigger, psychological or physical. Some depressions may well be caused by a spontaneous aberration in brain chemistry, with no trigger that we can currently identify, just as a seizure or migraine may have an obvious trigger or be apparently spontaneous. However, once the depressive state has set in, both physical and psychological problems will be generated in abundance. Most if not all of these effects form feedback loops, increasing in magnitude and becoming triggers for further depression.