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.