For any given location, a small town will always be at a disadvantage against a large town or small city when it comes to things where economies of scale are critically important: infrastructure, schools (to a certain extent), municipal services, any business or amenity that requires access to local customers or labor, etc.
As automation has increased over time, the "need" for more and more small towns has declined. Instead of having a family farm on 160 acres, you now have large spreads with thousands of acres. When 16,000 acres are farmed by four families instead of 400, the other 396 families slowly migrate away ... and the businesses in that town lose almost all their customers.
For many of these towns, the only way to survive is to do one or both of the following: (1) attract an industry that sells products over a large region (nationally, or even globally), or (2) give outsiders a reason to visit and spend money there.
Option (1) is increasingly difficult because these types of industries usually need infrastructure, amenities and workers that a small town can't provide ... and because it's hard for any given small town to differentiate itself from other towns as THE best place for a business or industry.
You Communist, how dare you insert rationality into a farrago of nonsense?