First you don't have to use XP.I sort of agree with this- and it really means that DnD5e just isn't the game for my world.
Providing challenging encounters for players means that your parties will level up every 4-5 sessions. I know everyone runs their games differently, so this varies, but just going by core 5e characters will reach high levels with consistent play.
NPCs either have to grow in power similar, and in numbers that can mean some die and there will still be more to challenge the party further down the line..
But in my mind, NPCs should cap out at level 11 or 12. Hell, I'd want characters to do the same. I guess I haven't been happy with this "PCs frequent power raising forcing NPCs to be higher level" dynamic since 3e- but at least 3e had variable XP tracks to slow down leveling (or maybe that was Pathfinder?)
I'm not satisfied with it, I'd love a solid "e6" ruleset for 5e. I've toyed with e9 rules but never had the chutzpah to use them at my table.
Second, if you do level up ever 5 or so sessions, and use gritty rests with about 1 month per level, then the game stretches over about 2 years of both real life and in-world time.
You can tell different stories over those 2 years.
L1-4 is Local Heroic. 4 months of in world and real life time. Mere mortals.
L5-10 is Regional or National Heroic. 8 months of in world and real life time. This is the limits a moral can reach without cheating.
L11-16 is Epic or Global Heroic. Another 8 months of in world and real life time. NPCs in this power tier have cheated to gain their power.
L17-20 is Legendary or Planar Heroic. 4 months of in world or real life time, and universe-changing events.
NPCs don't have to auto-scale for this to work. There just have to be challenges at the higher tiers. The Liches, Demons, Elder Dragons, or even squads of Giants -- all are reasonable challenges for Epic tier heroes.
There aren't any "masters of the blade" that scale with the PCs needed, and NPCs can cap out in the single digit levels (except, say, a 1000 year old elven swordmaster, who is level 11.)