In effect, if the world has fantastic elements, there can be a disconnect when you ask yourself how these would logically apply to a setting. How does X work is one of the fundamental human questions (right after What is X?, Can I eat X?, and Will X eat me?, I suppose).
Many D&D worlds handwave things like how they work, precisely how common monsters and powerful NPC's are, leaving it up to the DM to decide, but in your quest from level 1 to whatever the campaign can handle, you're likely going to encounter a great many creatures, spells, and strange phenomenon that would have a startling impact on the world- but a lot of D&D campaigns somehow manage to maintain an old-timey mashup of technologies and developments and are only minimally impacted by such- articulated plate armor yes, firearms no, printing presses maybe- no matter when such things were created in our world.
You still have castles that are designed to fend off attacks from non-flying dragons, no real defense from drow invaders from the Underdark, and creatures that could easily create more of their kind to become a vast swarm of anti-life (shadows, wights, etc.).
Most attempts to apply logic and reconcile all this can end up with dungeonpunk settings that are far removed from your typical fantasy campaign. Some come to the conclusion that the world is the way it is because the Gods (or a secret cabal of powerful NPC's) want the this way, will use their power and influence to maintain the status quo.
In reality, most people aren't concerned with whether or not their fantasy worlds are truly "realistic"- what they want is the illusion of such, hence the term verisimilitude. Few really want to deep dive into the nuts and bolts as to how fantasy economies really work, or how closely their worlds hew towards Earth- an oft-stated comment is "like our world save where noted", but that "where noted" generally precludes the laws of physics and a modern understanding of science to impact the world unless the DM wants it to be so- I once had to fight an Orange Dragon which had a breath weapon of "liquid sodium" that caused things to burst into flames and exploded if it came into contact with water.
One of the more scientifically-minded players started postulating the uses of this substance, and the DM quickly said "It's not really sodium, it's like sodium in it's effect, but it can't be used in those ways".
In effect, the drive towards making our fantasy worlds seem real as possible has always been very selective, and simulation often must defer to the needs of the game, such as matters of balance and setting integrity.