Any data for this? I think this maybe the real answer because unlike other explanations, this one can actually acquire proof from before modern ages. Simply because it's known that cities fertility rates were always negative and have to constantly pull people from countryside.
It's a well-known phenomenon. E.g.: https://link.springer.com/article/10.1007/s10680-008-9163-9
It's been eroding lately, but mostly because fewer younger people can afford to live in suburbs. By "afford", I don't mean monetary cost, but the lack of easily accessible jobs.
I'm investigating that, and I believe that it's even _worse_ than the simple fertility rate shows. If you look specifically at the number of parents with two or more children, suburbs completely demolish cities when you control for the average income.
Controlling for the average income is needed because of the two poles of fertility: desperately poor people, and happy content people ("reversed J-curve"). And cities in the US disproportionally concentrate desperately poor people.