Good thread.
In D&D the basic set up is each creature or organization of creatures has their own territory. Dogs can invade another dog's territory, France could invade Spain, and I could walk into your house uninvited. So cross-Monster Confrontations aren't the only kind, they can happen when the same kind of monster split into factions as well. Like humans in states or cultural nations.
Humans in D&D are the biggest population by far. That is the default set up by the game. Along with the notion that a Common language among humans is held by most. (Think Greyhawk's declining Aerdi Empire, Latin after the fall of Rome, or any trade language).
However, even being the biggest population doesn't mean humans control all the terrain in the area. There are borders. Borderlands where the human population defends itself against what they see as monsters. Campaigns usually start out here and the game rules originally supported that. Equipment prices were elevated to boom town prices and lack of availability. Death may be easy to come by here, but so are riches if you're willing to risk it.
When it comes to how creatures live, in mountains, in forests, in jungles, swamps, wherever, this is part of their cultural makeup. Their Ecology of cultural practices learned over lifetimes of trial and error as well as watching others. Humans are a huge population and incredibly diverse in how they live. So they could be living almost anywhere. But only almost. They still aren't like dwarves living their whole lives under mountains or elves in tree branches living for hundreds of years. And definitely not Giant Eagles, Dragons, Ixitxichitl, or Lurkers Above. Humans are more industrious in D&D in that they conform the world to them rather than vice versa like most creatures. In relation to other humanoids (kin) humans shorter lifespans make this industriousness a racial necessity.
So when designing (or generating if you do that) the layout of the local human population and claimed territory I would take account of not only the environment in toto, but the particular cultural practices of this group (in part informed by the growth in this environment), and surrounding creatures capable of encroaching on them, and the history of that territory from beginning to campaign start.
The Players going back to town are going back to a frontier town, not necessarily civilization altogether. They are on the fringe.
Going back to the city to where the Duke lives, surrounded by all his vassals, the paupers, and square miles of adjoining farmlands, towns, villages, and ports, is rejoining civilization. I don't think it should be that big, but it's big enough where people actually build and sell all the unique items in the PHB. Okay, maybe not all, but big enough to warrant trade with groups who do have those things.
Then dealing with people in the city can become it's own adventure. And the masses do feel real, if not quite modern in size. Yet still capable of being affected and altered by the PCs as they become more capable at making waves.
For me, the Keep in that borderlands is the lawful dungeon. The forces of Neutrality and Chaos in the territories surrounding humanity are balanced against it. Their are monsters out there. And all the forces of the duchy and all their nearby allies are in relative balance with those against. IOW, the humans haven't "won", but neither are they points of light in darkness.
You might try something different like kingdoms of orcs squaring off against humanity or a group of dwarfhold clans, but it's up to you and your players. Lots of set ups are possible.