Economists have studied this pretty extensively. What they've found is that every time a city doubles in size, its economic productivity goes up by around 5-7%[1].
This relationship seems to hold across a remarkable range environments. In the ancient times, in modern times, in the Renaissance, in American, in Europe, in Asia, in the first world, in the third world, and so on.
This is what makes bootstrapping a new city so difficult. Let's say your economic metro has 10 million people. even if you manage to coordinate 100 thousand leaving together, the new city will still have nearly 50% lower productivity than the old mega metro.
Density seems to boost productivity by making it easier to quickly spread innovations. Think about Silicon Valley. There are hundreds of tech companies in a single job market. New technologies and approaches. Employees switch companies every six months and bring the best practices to their new firms.
Take those same companies and disperse them across the continental US. Workers don't move firms because relocating is expensive, unpleasant and risky. Instead of bouncing between jobs every six months, people stay "loyal" to their local employer for decades at a time. Every time a new innovation is discovered at one firm, it takes orders of magnitude longer to diffuse across the industry.
Think of the major improvements in software engineering during our lifetime. Things like devOps, test driven development, microservices, rigorous source control, code review, open source, containerization, and the like. Silicon Valley adopted all of these practices years, if not decades, before the average IT department in Tulsa or Jacksonville.
[1]https://www.jstor.org/stable/1885259?seq=1