To build on top of what <PERSON> said, there are really three core concepts behind the stagnation of technology in high fantasy settings. Not all apply to Arda but they apply in different measures in different fantasy worlds.
Dark Ages
Most of human history, as <PERSON> pointed out, takes place in periods of stagnated development. Sometimes the result of the downfall of a civilization, and the loss of technology. Sometimes due to religious reasons. Sometimes just due to being so early in the development of a species that advancements have little to build on.
Progress, despite what we are taught about genius and hard work, is more a function of all the required pieces being in place to enable the new advancement. Today, we live in a time of unbelievable advancement. However, the advances from the Bronze age to the Iron age took some 2000-5000 years depending on where we are talking about.
The idea of lost technology plays a role in the different ages within LotR. However, it is mostly about lost forging techniques and would be analogous to the loss of being able to make Wootz or Damascus steel. This is why a first age sword might be so highly prized in a LotR context. This is exactly like how a ~2000 year old Wootz blade might cut through modern armor in the year 1600.
Magical Science
Not a big force in LotR, but present somewhat. Progress is always about doing something better than the prior process. If the prior process is a magical one that makes a 200 Ton stone door move like it were made of cardboard, it is very hard or impossible to create a mechanical process that can compete. And it would be even more unlikely that anyone would bother to try. The presence of magic almost ensures a slowed-down progression of technology for this reason alone.
Additionally, there is a brain-drain associated with the magical arts. While not really a factor in LotR lore due to the rare nature of true magicians. In most other high fantasy worlds the mentally gifted enter magical schools. They learn magical arts, not engineering. 88
They learn to create potions, they learn 'mend wounds' spells, not how to suture a wound with thread. All the smarties are advancing magical science, not physical science.
Progress really isn't stagnated at all. Science and technology are about learning to understand the world as it is, and learning to make use of those facts. If your world is like ours and lacks demons, spells, enchantments, magical teleportation, dragons, so on; then your technology and science will bear that out and you will advance along the same threads that we have.
But if your world features those things, and at the strength that most fantasy worlds give those powers, advancement will rightfully be along those lines instead.
Magical Ritualism
In many fantasy settings, magic attempts to look like it did in our own past. This means extreme ritualism. This is a form of anti-science and does not seek progress. It seeks tradition. I once heard someone say, of modern magic and science, that "Science is the attempt to eliminate from rituals that which is unneeded, and magic is the attempt to honor the tradition of the rituals that produced the refined technology."
Steel-making was once, and in some places still is, a ritualistic and magical process. One common way to produce steel involved folding the iron, binding a slip of magical paper to the block of iron, pounding the paper into the iron, folding again and repeating 100 times. When we strip away the layers, you are adding carbon to iron which is exactly what is needed to make steel. The magic worked. The ritual was passed down from Master to <PERSON> and without any knowledge of the underlying reason, steel was producible.
This is how Wootz steel could be created ~3000 years before we had any idea what carbon nanotubes were.
A society that has given themselves over to ritual, would by definition not progress. Many fantasy worlds are dominated by ritual, and yet can't be said to be in a dark age, because those rituals produce really advanced results. There are historical examples of this. Ancient Egypt was able to build some of the most enduring landmarks, create a nuanced and long-lived culture, and be very productive and even culturally progressive all while being very ritualistic. They did so by adopting the rituals of others along the way. However, if the whole planet were Egypt, then they probably would mirror many of these fantasy worlds. And they would have retained their rituals much longer, and they would have been more powerful, as in the fantasy world the gods would be real. 111