Larger populations, specialization of labor, and fortifications made city-states militarily superior to small bands of hunter-gatherers and allowed cities to dominate a surrounding region (at least until the modern horse). When a region was depleted of wild game then cities and their croplands were the most reliable source of food. Armies from city states would not infrequently raid and capture smaller groups of humans and bring them back to cities as slaves.
So cities were likely a forced choice, as smaller nomadic groups were forceably absorbed into the domains of city-states or repelled toward less hospitable lands.
Put it one way it's bad, put it one way its good. It's a choice with tradeoffs - I'm just pointing out that those tradeoffs aren't some uniquely new "collapse of our society" thing.
"People can't afford leaving city" suggest there is active price to be paid for ability to be somewhere - transport, house elsewhere being too expensive or some such. It does not even suggets opportunity cost.
Otherwise said, first sentence means people move to city because it is better for them economically. Second does not say anything about whether it is good for you, just that moving away would cost too much. Also, some people stayed in economicaly bad places, because they could not afford to move to the better place. Transport and initial housing pay was too much.
Riffing:
I think there’s a middle phrasing similar to “cities are the most efficient allocation of resources we have yet invented.”
Similar to the “democracy is the least bad system of government yet invented.”
There’s some corollary to survivorship bias at play here as well. Cities are an apparently natural consequence of human civilization so we know a lot about their flaws. But civilizations that didn’t migrate toward cities either failed or records of their existence was lost.