NPCs are virtual life forms created in order to allow the Holy Grail War to proceed smoothly.
They each have their own predetermined role, and they cannot to deviate from it. However despite their role being decided, they are each equipped with their own unique thoughts and personality.
If NPCs were not realistic living beings, they would not be able to evoke genuine reactions and responses from the Masters who encounter them.
Moon Cell calculated this and this is why the NPCs were bestowed with artificial intelligence.
However an NPC’s “personality” is a one-time-only prospect, and no deviation is allowed from their preset perspective of the world.
Once the Holy Grail War ends, Moon Cell confiscates their accumulated experiences including any gained physical ability, knowledge or personality development. Everything is reset, and they are equipped and re-tuned in preparation for the next Holy Grail War.
To the NPCs who know they will suffer this fate, Masters are an object of envy and even hatred.
Jerked around by the illogical actions of humans and treated as expendable tools, more than a few NPCs are unsatisfied with their existence in the world.
In a way, life is bestowed upon them, but it is also denied to them.
They are simply something that is “here” or “not here.”
Their discontent built up to the point where it gave birth to an urban legend. It’s said that at the end of their so-called reincarnation cycle, NPCs with a high level of humanity, meaning those who obtained a soul, are upgraded to be high-level AIs.
Of course, no such future exists for them.
Even if such a thing were to happen, as far as Moon Cell is concerned, it would be no more than a meaningless bug.

Fate/EXTRA Material: Encyclopedia of Fate/EXTRA

Artificial virtual organisms created in order to run the Holy Grail Wars smoothly.
NPCs are programmed with specific roles, and can not deviate from their designation, however, the Moon Cell assigned each NPC its own individual personality and thoughts.
The Moon Cell calculated the need to create and use them, while also observing that the Masters would need to be able to interact with them on a genuine human level.
However, their “personas” were meant to be disposable, and it was impossible for them to escape the world view that was programmed into them.
Once each Holy Grail War ended, the Moon Cell would confiscate the NPCs’ accumulated experiences and memories. Everything about them, including their bodies, stats, and personalities, would be reset, and they would be recycled as “tools” to facilitate the next Holy Grail War.
Such was their lot for many years, but now that the world has been reborn as the new SE.RA.PH, the Moon Cell granted each of them the right to continue living as they are. Although they still have roles to play, their faces are definitely brighter now, considering there’s no longer a giant reset button about to be pushed that terminates them once the battle of the Masters comes to an end.
Some NPCs desire to become true Al by embracing their humanity. They are driven to improve themselves. The sudden influx of new NPC businesses in New Rome and the Millennium Capital is not due to a widespread awakening to the spirit of capitalism; rather, the NPCs are gathering resources in order to make their dreams come true.
And yet Tamamo, ever the evil dictator, mercilessly taxes their hard-earned wages.

Fate/EXTELLA material: Encyclopedia of Fate EXTELLA