Obviously a lot of depression is genetic or due to some unfortunate life circumstance. It's got nothing to do with intelligence.
But what I've also noticed is that a lot of people with unbalanced lifestyles end up becoming depressed.
For example, they might have a habit of going to bed at weird inconsistent times, wake up late, eat junk food, not regularly exercise or go to the gym, etc.
Someone with that lifestyle is much more likely to become depressed compared to someone who sleeps 8 hours a night, wakes up at a reasonable time every morning (i.e. 5am - 8am), has a stable job, and exercises regularly.
Humans are built for routine. Drifting away from that is unnatural.