I live in the Black Hills of South Dakota, a region filled with the ghost-town remains of a multitude of small towns left after previous industries vanished (both related to gold mining as well as tin (selenium) and uranium mines and lumbering.
Simple economics is what destroys a town when its primary industry leaves. Even in the largest towns, when "all the eggs are in only one basket", it impacts and harms all subsidiary business in that area. Back then business was not as diversified as most communities have tried to make it today, and thus more 'survivable' should some calamity befall the primary industry that started the "rush" town in the first place.
In the case of ore mining, when the lode (or in Black Hills gold mining also known as a "lead" (pronounced "leed")) runs out, and there is no longer anything worth assay value in the rock with which it was amalgamated, no one has something of value to trade for. Without "pay dirt", there is no need for assay offices, stamp mills, wheelwrights or wagon makers, or hardware and "outfit" suppliers. Thus it is for all parasite businesses (food, hotels, saloons, "other entertainments", livery stables or garages, grocers, general stores, and specialty shopkeepers of every kind that were wholly dependent on the employees (and their families) of that primary industry for their business, also end up going out of business.
Wealth in those earlier years was derived from a solitary resource, and not all communities even today are immune to the effects of a prime resource going out of business or leaving the area. Look at what happened to Pittsburg and Cleveland when the steel industry tanked and corporations decided it was better for their bottom lines to abandon American workers and take their operations off-shore to mostly Asian countries.
I grew up in rural and small-town lower Michigan within an hour's drive of Detroit, Saginaw, and Flint, Michigan, towns that eventually became sole-industry giants for many decades. No one ever imagined the "boom" would end. There is a reason Detroit is known as Mo-Town or the Motor City. Ford, GM, and Chrysler (and all their off-shoots and subsidiaries) made their fortunes there, and that part of the state was known as the "arsenal of democracy" in that they built thousands of tanks, jeeps, trucks, rifles, machine guns and bombers for the war effort from World War I through Vietnam. But in the 1990s, after the Clinton administration granted "most-favored-nation trade partner" status to China, it instigated a wave of mass migration of major U.S. corporations of the old auto and steel industries for Asia (Mexico, and others as well) where labor was cheap, and where the companies got HUGE monetary incentives to build factories there. Again, American skilled labor was abandoned for cheap labor in other countries. Massive American corporations started feeding other families in the largest Communist oligarchy on earth, while millions of Americans ended up forced to live off of welfare programs until they could retrain themselves to be marketable in other career fields. And for some, they could never adequately make that transition. Saginaw, Michigan had massive plants that built machine guns and M-1 carbines during W.W. II, General Motors auto bodies, and steering gears for EVERY vehicle manufactured in America, Europe, etc. ALL of them shut down. Flint, Michigan had massive plants that built Buicks, General Motors and Chevy vehicles, and AC Delco products (including spark plugs) for every vehicle. Dearborn, Michigan, long the home of Ford Motors, severely scaled back, in a devastating move to the industry, almost as bad as when they closed their massive River Rouge plant. All those major cities with HUGE populations were decimated as hundreds of thousands of employees got laid-off permanently with weak or no-compromise severance packages, leaving their families nearly destitute. The high-paying factory labor jobs that been their family livelihoods for entire generations, having been the only thing they ever knew, were now gone forever. (No matter what you might think of film maker Michael Moore, his film "Roger & Me" explains it far better than I can.)
Today, even the post-agricultural, post-industrial, service-industry-only economy can only sustain so many. Not everyone wants (or can provide for their family with) a lifetime career making beds in a motel, waiting tables or stocking Walmart shelves, or serving French fries at McD's. Hence, simple economics, the same thing that killed all single-industry towns like gold-rush towns, can also kill entire cities unless those city planners involved work hard to cultivate diverse industries that would help them sustain populations if one or more of their industries collapsed or simply had a "change in corporate direction."