Viktor Frankl talks about this in his groundbreaking work he developed in part during his time in the Nazi death camps. Logotherapy. I quote:

“In the Nazi concentration camps, one could have witnessed that those who knew that there was a task waiting for them to fulfill were most apt to survive … Thus it can be seen that mental health is based on a certain degree of tension, the tension between what one has already achieved and what one still ought to accomplish, or the gap between what one is and what one should become. Such a tension is inherent in the human being and therefore is indispensable to mental well-being. We should not, then, be hesitant about challenging man with a potential meaning for him to fulfill.”

I’d need to quote more to get the whole picture across, but basically, his realization was that we need some sort of dream or future to strive toward or hope for otherwise we lapse into what he calls the ‘existential vacuum’ from which depression follows. He emphasises that one must certainly not find a place of ‘equilibrium’ or ‘homeostasis’ but bigger and greater desires, contrary to a lot of popular psychology.