I don’t know if I completely agree with this. I’ve suffered from depression and anxiety my whole life, and maybe sometimes this is a response to something in my environment, but most of the time I just feel sad for not reason at all.
Modern life is not much like what we evolved in, but that many people do fine in it shows that environment is not determinative.