While some historic images of urban spaces in Europe might depict densely packed cities, many of these depictions have the objective of depicting or embellishing a story, rather than accurately depicting a cityscape. Depictions of cities meant to be more accurate paint a different picture, and do display lower density between the center and the city walls, which could even dissipate to become open spaces like pastures, orchards, or vegetable patches. In addition, it was common for there to be smaller communities either directly outside the city walls (especially around gatehouses and major roadways) or in the surrounding area; communities which would naturally be intimately tied to life in the city, even if they were distinct from it. If you're interested, I wrote this answer as well as this other answer which might interest you, examining the relationship between city growth and fortifications through the lens of my own knowledge of Italian urban planning and urbanization patterns.