This is a toy psychological theory which tries to explain why gratitude practices and stoicism have good effects.
Your "need-set" is all the things you need. More specifically, your need-set is the collection of things that have to seem true for you to feel either OK or better.
Broadly, we have two kinds of motivation: positive and negative. Positive motivation is when you want something and try to move towards it. Negative motivation is when you want to avoid something and try to move away from it. Positive motivation is much more detailed in its targeting and tries to do as well as it can. Negative motivation is often faster and scrambles to find any acceptable solution to the problem. From the inside, positive motivation often feels relaxed or enthusiastic, while negative motivation often feels frozen or frantic.
When you have everything in your need-set, you generally experience positive motivation. Here, you pursue things that are not in the need-set that are just nice-to-have. Conversely, when something in your need-set is missing, you generally experience negative motivation. When something you really need is missing, you may not care so much how you solve the problem, just that it goes away.
The need-set expands and contracts adaptively. When you have something good for a long time, and it seems very reliably there it often gets added to the need-set. This is called "taking things for granted". When you lose something in your need-set and finally, after attempts to get it back, give up, the thing drops out of the need-set. This process often gets called "grieving". Of course, this is oversimplified; these are not the only processes whereby things enter and exit the need-set.
In the modern world, negative motivations are overused. This is partially because the environment we evolved in is far harsher than the one we find ourselves in today. As such, negative motivations seem, to a significant extent, selected for running away from lions, avoiding getting killed by the other tribe members, and the like. However, in the industrialized world, we have basically no remaining natural predators (the ones we see tend to be locked in cages for our amusement) and violence is at very low levels. As such, because of our (comparatively) vast wealth and cushy lifestyles, we have many opportunities to take things for granted, thereby creating opportunities for negative motivation.
A subtler psychological peril is that pleasant false beliefs can linger and then enter the need-set. The resultant sort of negative motivations to protect false beliefs seem to be the source of a fair number of cognitive blind spots and egoic defense mechanisms.
For these reasons, greater psychological health can be obtained by shrinking the need-set or by preventing it from growing unnecessarily, because shrinking it would result in more states of the world invoking positive motivation rather than negative motivation. Stoicism, with its negative visualizations, wards off taking things for granted; even a visualization counts towards not taking something for granted.
Gratitude practices may do a subtler version of this. While the visualizations may be pleasant, saying one is grateful for something seems like it may (at least subconsciously) involve comparing it to a world in which that thing does not exist. Additionally, by cultivating good feelings about the things one already has, it may aid with the grieving process; the process is likely to be set up to struggle less when letting go of a supposed need, the more positive feelings one experiences. That said, there are also non-need-set related positive effects gratitude practices have. For example, I think they also put one more in touch with one's positive preferences.
First point: I was quite surprised when you said that
Our ancestral environment was harsher in terms of providing fewer means to satisfy our need-sets, yet the modern environment seems to me harsher in terms of the overall level of unhappiness. Perhaps the reason for this unhappiness is that as our need-sets grow, we become more and more entrenched in anxiety and depression as we are negatively motivated more and more of the time. I think you said some of this yourself in the post. Would you agree with this synopsis?
Second point:
I think we experience negative motivation not just when something is missing from our need-set, but also when we anticipate losing something that is in our need-set. If this is true then a larger need-set would lead to more negative motivation due to there being more ways for something we think we need to be taken away from us.
I broadly agree. Though I would add that those things could still be (positive motivation) wants afterwards, which one pursues without needing them. I'm not advocating for asceticism.
Also, while I agree that you get more happiness by having fewer negative motives, being run by positive motives is not 100% happiness. One can still experience disappointment if one wants access to Netflix, and it's down for maintenance one day. However, disappointment is still both more hedonic than fear and promotes a more measured reaction to the situation.