The Gemara on Amud Aleph uses a phrase to describe death as Nach Nafshei, as his soul at rest. This phrase is used in Shas, and has similar connotations to the more modern phrase petira. Petira presumably means to be discharged, as in an honorable discharge from the army. In this case a discharge of the duties of life. So too, Rav Tzadok MiLublin (Resise Laylah 1:1 and Dover Tzeddek, kuntros Ner Hamitzvos 2) says is the origin of the term Nach Nafshei. Life is a constant struggle to achieve good over evil, and one can only truly rest after death.
This might seem depressing and exhausting however the opposite is true. Human beings are mercifully wired by God to enjoy challenges. We quickly become bored, restless and even depressed when we have no challenges. This is why billionaires who don’t need to work a day in their lives keep working, and some of them even moronically risk their lives flying rocket ships they built!
The formula to happiness is not about complacency. Happiness comes from encountering fair and appropriate challenges and then succeeding by meeting them. It’s cyclical just like hunger and sleep pangs. The tension builds up when you want to attain it, it is TEMPORARILY pleasing to obtain it, and then a certain restlessness starts the process all over again.
The depressed person is unhappy because this process is broken. In different people it breaks in different ways. The goal set might be too hard because of unrealistic standards or perceived as too hard, or the results are minimized and not appreciated because of an internalized sense of self criticism. When this formula is subverted there is unhappiness, and when this formula is kept there is a sense of purpose, fulfillment and satisfaction. It’s as simple as that.