I was reading a story where the narrator talked about how City A had weak walls because they prioritized the growth of the settlement and to be easier for people to moved around while City B was very defensible with its high thick walls but as a result grew slowly as a settlement.
Is this true?
Conceivably, the scenario described could certainly happen. Man made factors are important determinants in urban growth. However there are a multitude of other factors that also go into urban growth beyond the simple circumference of a fortified city limit.
An urban wall does more than just protect the inhabitants of a city when they are threatened. A wall is a marker of the city limit, and by controlling access points through gates, tolls can be collected on goods travelling in or out (fairly universally, this was a major source of income for urban authorities). Gatehouses can even become reference points for urban neighborhoods: in the Italian city of Milan, whose urbanization process I am very familiar with, the administration of a neighborhood gatehouse was a major political appointment. Indeed, in Milan neighborhoods continued to be named after the nearest gatehouse for centuries, even as the urban administration evolved. So my point is that a city wall does not necessarily hamper a city's growth or development, indeed it can contribute to a city's growth! A city like Milan, which is fundamentally strategically indefensible, still retained its walls well into the early years of the 19th century.
Not only aren't city walls necessarily a constraining factor, but prior to industrialization the tools available to urban authorities to incentivize settlement in one place as opposed to another weren't really decisive (maybe, in the Early Modern Era, expanding bureaucracies could act as a decisive population boon). Much more important were an individual location's advantages or disadvantages, along with the advantages and disadvantages intrinsic to the institutions built by society which existed in the urban settlement. Typically though, migrants to cramped cities could find workarounds to live in more tolerable conditions, typically settling in communities just outside the city walls or in less dense communities nearby. This is, in fact, a key feature of urbanization in Italian regions like Tuscany or Lombardy. The pre-modern history of Tuscany characterized by fierce and often violent confrontation between urban communities led to the construction of massive fortifications in towns like Florence, Siena, Lucca, and Pisa. These fortifications would remain standing well past the emergence of a unitary Tuscan state in the Early Modern Era. While Tuscan urbanization was driven by a multitude of factors, the ability of satellite communities to tie their economies to these leading urban centers certainly relieved population pressure; Florence itself would never even be subject to a major urban planning initiative until its temporary stint as capital of Italy in the 19th century. A similar phenomenon emerged in western Lombardy, focused around the city of Milan: satellite communities sprung up along waterways connecting the city to the country's river systems, creating Italy's largest urbanized area. Lastly, if an urban community has a real capacity and need to expand, local authorities can implement a quick fix: trace a new city limit with a cheap wooden fortification or palisade, and fully embrace growing urbanization outside the walls. Between the twelfth and fourteenth centuries cities like Bologna, Milan, and Florence would do this and eventually construct multiple rings of stone walls as communities outside the old city limit grew in size and importance.
All this is not to say the construction, retention, and mutation of city walls was a topic taken lightly by urban authorities. Indeed, the topic continues to be contentious today as urban authorities try to balance archeological responsibilities with the needs of modern urban landscapes.