Some people tend to get depressed because their brains are biologically tuned to be better at perceiving and focusing on negative information in the environment.
Living in a hostile environment is particularly bad for these people. Interestingly, there is some evidence that living in a supportive environment is particularly *good* for these people.
Many "risk" genes for mental illness may be more accurately described as genes which make people sensitive to the environment, for better or worse.