It’s the reverse of this that makes it possible for California to build this hugely expensive infrastructure. As California grows, it has more people to shoulder the cost of expensive water-treatment facilities, even if it doesn’t have much water. For citizens, these opposite dynamics have enormous consequences: The average water bill in Flint as of January 2015 was $864.32 a year, according to a report from the advocacy group Food & Water Watch. The average annual water bill in the state of California? Around $385.50, if the system is publicly owned, and $452.25, if the system is privately owned, according to the report.

The contrast between San Jose and Flint illuminates a truism about regional inequality in America: The cities that are struggling the most also have the least resources to deal with their problems.

“It’s almost like a death spiral—as a city gets smaller and smaller, the costs remain fixed, and the remaining people have to share in those costs,” said David Sedlak, who directs the Institute for Environmental Science and Engineering at the University of California Berkeley. In Silicon Valley, by contrast, “The area is thriving and tax revenues are up and there are a lot of people, which makes it easier to build public-infrastructure projects.”

A growing population also means that governments can count on having more customers in the future to carry the costs. To build the Silicon Valley Advanced Water Purification Plant in San Jose, for example, the district spread the cost out over 20 to 30 years, Pam John, the North Water treatment Operations Manager told me. They could do that because the area is almost certainly going to continue to grow: The population of Santa Clara County is projected to expand by 36 percent by 2040, which would make it the fastest-growing county in the Bay Area.

What’s more, companies are contributing to ensure that they’ll have access to water if they continue to expand. Apple is pitching in $4.8 million on a $17.5 million project to expand Santa Clara County’s recycled-water pipeline, for example.

But the municipalities of the Rust Belt are shrinking. The population of Flint was 141,000 in 1990; it’s now around 99,000. Detroit’s population fell to 688,000 from more than 1 million in 1990. Toledo, which faced a water crisis of its own in 2014, lost 50,000 people, or 15 percent of its population, in that time period.

As populations shrink, the costs of providing water and other infrastructure services don’t go down. Water districts have to pay for pipes in the ground, the people who work for the utility, the bonds they bought years ago to build the system, the plants that clean water and prepare it for taps.