Medieval demographics and a medieval society work with D&D magic as long as you assume that high-level characters are fairly rare. But once you assume the opposite, all that goes out of the window.
And of course, exploring how a world with high-level D&D magic would
really look like was one of my motivations for creating
Urbis...
In this world, castles don't really exist as modern fortifications anymore. There are some border outposts that might resemble them somewhat, but they aren't designed for lengthy sieges - just as a base from where you can send your grunts to combat zones, just like military bases today (which also aren't designed for sieges).
City defenses are centered on
Nexus Towers - magical constructs that enable even relatively low-level spellcasters to cast epic spells. Any large hostile army appearing on the horizon is simply going to be toast.
Instead, when you try to conquer a city-state or other strategic location, you send in high-level "special ops" to take out key defenses - fortifications, Nexus Towers, or high-level or politically important NPCs. If you cann pull that off,
then you can send in your low-level grunts. You don't expect them to fight high-level enemies or dangerous monsters on their own and win. Instead they are there to "pacify" the area and cow the normal population.
And if a patrol or two goes missing in a certain area... Well, then you know to send in your specialists to investigate.
I've written a short essay on various forms of warfare in Urbis, which you can find
here - most of it should be applicable to most D&D worlds with lots of magic...