It's a good point.   Depression has a lot of causes/triggers, and genetics are often involved in some way.   It's very difficult to disentangle.

Taking something like PTSD.   If 20 people go through the same exceedingly stressful experience, and 8 develop PTSD and the rest don't, then what was the cause?   Or, perhaps another way of looking at it is to ask why some people were resilient and others weren't?

There is bound to be a physiological/chemical element involved in resilience that perhaps can be tied to genetics in some cases.