Narcissism and resentment go together. The usual explanation is that narcissists are resentful because the world doesn’t recognize their brilliance or meet their demands for special privleges. That's probably true in a great many cases. But it is also possible that chronic resentment leads to narcissism.
A derivative of innate anger, resentment emerges in pre adolescence when children develop a strong sense of fairness. Resentment requires a perception of unfairness. It shares the physiological characteristics of anger but is less intense and of longer duration, i.e., it reaches much lower levels of arousal but lasts much, much longer. Where anger (when directed at others) is an aggressive exertion of power to get someone to back off or submit to what you want (either in reality or in your imagination), resentment is a defensive way of mentally devaluing and retaliating against those whom you perceive to be treating you unfairly.
Preadolescents are vulnerable to resentment because they perceive a lot of unfairness, in large part because the immature prefrontal cortex cannot objectively evaluate their behavior. This deprives them of context for evaluating the fairness of other people's behavior and makes them feel bewildered and illused by negative feedback they get from those whom they offend. As a result, their egos are generally fragile, in need of a lot of defense. Resentment functions as an ego defense when perceived unfairness seems to devalue the self.
If a child perceives a lot of unfairness, resentment expands into a defensive system, which activates whenever he/she feels uncomfortable. The systematic use of resentment as a defense occurs before prefrontal cortical development can provide a substantial sense of self that is less in need of defense, i.e., less fragile. Pre and early adolescence is characterized by black and white thinking and oversimplification, with fantasy substituted for self awareness and unrealistic projections obscuring awareness of others - characteristics retained in adulthood by the resentful and the narcissistic.
Maturity of the prefrontal cortex provides a substantial sense of self for most people, who are able to outgrow the need of resentment as a generalized ego defense. The mature self is less in need of defense because it is more realistic, self-aware, and perceptive of actual social context of achievement and acceptance. However, the prefrontal cortex does not reach full maturity until the late twenties. By then, some people have formed entrenched habits of using the low-grade epinephrine, nurepinephrine, and cortisol of resentment for energy and ego defense. As a result, they are less able to avail the full power of their prefrontal cortex to counteract the confirmation bias and cognitive distortions inherent in resentment, much less to fortify a sense of self free of unrealistic attributions and projections. Because the world seems to treat them especially unfairly, they feel entitled to special compensation. In other words, they become narcissistic.