"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.
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.