I found this video while doing some research on some of the more basic things about World Building. In specific I was looking for how far apart towns should be under normal conditions. The answer was surprisingly short - about 10 miles. The video gives more specifics on it.
This is good to consider when you are developing your world. In general you should have towns about 10 miles apart in populated areas. In the 5 mile circle around the town should be the local villages. In the area around that village will be things like farmers and such.
The basic structure is you have a city. The city has a number of towns surrounding it that support the town. Each town then has a number of villages around it that support it. As a town grows, it will reach and then consume the villages that support it. Cities will do the same to towns.
Villages to Towns
Most RPGs deal more with towns and villages than cities. So how many villages will you find around a town? Well, a fun post on Stack Exchange(found here) had a great response with links for supporting information. In that post, the person posited that for every 300 people in a town, it would need 1 supporting village and the villages surrounding farm land.
So a town with a population of 3000 would have 10 satellite villages and farms around it. The farms would feed the villages, the villages would feed the towns, and from there the towns could feed cities.
How Does This Work In Game?
In game this is good to know because as your PCs get closer to a town, they're going to run into the surrounding villages and farms first. Probably a good day or two of travel before they reach the town. That means farms they could maybe sleep at, villages that might have inns, and more importantly roads and commonly traveled paths. Villagers who will want news from where the PCs came from. People who will want to know how the travel is out that way.
This is also important to keep in mind for adventure seeds and other things, because before a goblin horde can hit a town they're probably going to feast on the outlying villages and farms. This also means your PCs can have a chance to deal with them before they get too big, which in turn gives you a chance to show a living world and consequences.
For example, while the PCs are doing something relevant to their current adventure they get word that there have been some villagers going missing and some livestock gone similar. Maybe they divert. Maybe they don't. If they don't, but are in the area, they might next hear that a village was burned by bandits or something else. Maybe they go now. Maybe they don't. PCs sometimes don't live diverting their path. But if they ignore it enough, that small group of goblins that was abducting a few people could be a much larger threat that now feels confident to hit the town. Or if the PCs go early, they can stop it all early and maybe they get less reward over all - the goblins didn't build up enough loot if they got stopped early - but they also get saved villagers and farmers who may be very happy with the heroes who cared about the little guy.
Remember, Monsters Are Real
One thing to remember is that games like D&D don't work with the whole land fully developed and villages and towns covering everything. There needs to be large swaths of land that is unexplored and wild for adventures to happen in. For hordes of orcs and goblins to form up and come from. For dragons to slumber. For wizards to set up their towers in remote locations.
These places may have once been settled by the civilizations that came before, but you need the wilds to have a lot of the classic adventure seeds.
This doesn't change how far apart towns and villages are. It just means at a certain place they fade out and you acknowledge that. Frontiers happened all throughout history. Even in the real world there are places with hundreds of miles without towns or villages. But you do want to remember to leave yourself that space when building your worlds and locations.
Just like you want to leave some gaps in your character backgrounds to develop and fill in throughout the game, you want to do that with your world too. Leave room for the PCs to explore. Leave room for you to add things you missed or forgot while making it.
Remember that, unlike the real world, in this world there are monsters, there is magic, and there are gods. The idea of those things kept people in villages and slowed exploration down in the real world. In a D&D world, they will actively fight back to defend where they live. People setting up a village will have problems with the local life not wanting to adapt to these intruders.