Over the last half-century, a once overwhelmingly rural world has become ever more urban. In 1960, the urbanization rate in the majority of poor countries was less than 10 percent. Just 3 percent of Botswana’s population lived in cities, for example, while Kenya was 7 percent urban and Bangladesh (then East Pakistan) was 5 percent urban. Even China had only 16 percent of its people then residing in cities. Nowadays, China is more than 50 percent urban and Botswana more than 60 percent. In those two countries, industrialization and increasing prosperity have accompanied the population shift to cities. China’s real per-capita incomes have risen 25-fold since the early 1960s, and Botswana is more than 17 times wealthier. This has been urbanization’s usual historical pattern. In 1961, a 1 percent increase in urbanization was associated with per-capita earnings growth of 3 percent. And the trend is even stronger today: in 2011, a 1 percent rise in urbanization was associated with a 5 percent boost in earnings.

Yet while urbanization continues to correlate with prosperity, recent years have seen the striking rise of a new phenomenon: urbanizing countries that remain poor. Urbanization has increased from 5 percent to 28 percent in Bangladesh and from 7 percent to 24 percent in Kenya, for example, but prosperity has stood still. The urbanization of these poor nations doesn’t take the form of midsize urban centers, like those that sprouted along most of America’s major nineteenth-century waterways, but typically of a single megacity. The Nairobi agglomeration has a population of 3 million; Dhaka has 15 million inhabitants. The Democratic Republic of the Congo is the ultimate example of this new form of impoverished urbanization. Its capital, Kinshasa, has 8.4 million people, while per-capita income in the country is about $250. Haiti is also an extreme case, with an urbanization rate of over 50 percent and a per-capita income under $1,000. Karachi has 13.5 million inhabitants; the per-capita income in Pakistan is about $1,200.

These impoverished big cities are mostly located in poorly governed countries, lacking stable institutions and strong property rights, which helps explain why economic growth hasn’t taken off in them. But if these vast urban agglomerations aren’t providing much economic opportunity, why are rural people still moving to them? And how can such cities, with extremely limited resources, deal with the perpetual demons of density, including contagions, crime, and housing? Can a megacity of almost 9 million people in a country where incomes average $250 a year be anything but a hell on earth? Cholera rages in Port-au-Prince and Kinshasa; hundreds are killed each year by the commuter trains of Mumbai. The awful downsides of urban poverty might seem to support limits on urban growth or a more aggressive focus on rural development. But cities are the present and future of the developing world. The great challenge of our century will be to make them livable.

It might seem that the world’s wealthy metropolises are so different from places like Kinshasa that their experience has little relevance. But the history of New York itself is the story of a city struggling to make itself livable, despite world-class corruption. Developing-world megacities need to learn the lessons of the fight for better urban government, as much as they need technocratic advice and new technologies.

Why has poor-country urbanization become so common when it was once rare? In the broadest sense, it is because the longtime connection between agricultural productivity and urban growth has been broken. From medieval times and for centuries afterward, famine-causing disasters didn’t send peasants flocking to the nearest town or city—that path led only to starvation. Staying close to the land offered the best chance of survival. Cities grew only when they could tap vast agricultural surpluses and, crucially, had the means to get that food delivered reliably from their hinterlands.

New York is a good example. Back in 1875, as it crossed the threshold of 1 million inhabitants, the city could easily feed itself with the products of fertile western farmland. Thanks to technological improvements like Cyrus McCormick’s mechanical reaper, the farms had begun to produce a lot more food than farmers needed to feed themselves. New transportation infrastructure—the Erie Canal and the Intercontinental Railroad—made it possible to move all that food swiftly to the city. And Gotham’s entrepreneurial success in finding markets for its relatively sophisticated products, like printed books and refined sugar, gave it the wealth to buy and transport the food, which, in turn, enriched America’s breadbasket. In earlier cities with more than 1 million people, like ancient Rome, military might and bureaucratic competence played the role that entrepreneurship did in New York. Unlike the Iowa farmers shipping wheat to Manhattan for profit, Egypt wasn’t willingly emptying its granaries to feed Rome. But the empire’s sword made sure that the food arrived all the same, efficiently moved over great distances by the Roman legions.

The cities of the poor are expanding without food surpluses or increased agricultural productivity. The rural hinterlands of places like Port-au-Prince and Dakar are still grindingly poor and unproductive. What is feeding these cities is the global economy. Farms in Argentina or Australia or Kansas are providing abundant, inexpensive food to Port-au-Prince and Karachi and similarly poor cities. The Democratic Republic of the Congo doesn’t need to feed Kinshasa, and couldn’t if it had to rely on its own agricultural output; a caloric river flows into the city from the outside world. To pay for the city calories, the poor countries sell minerals or other commodities or rely on foreign aid. They tend not to export industrial manufactured goods because they don’t make any. Almost 50 percent of Liberia is urbanized, for example, but manufacturing of goods that might be exported accounts for only 3 percent of GDP.

For a subsistence farmer in Bangladesh or the Congo, a move to the city, poor as it might be, still makes sense. He often has a better chance of getting food coming off a boat in a city port—living off the scraps of globalization—than he did getting it out of the ground, left fallow by poor soil and worse organization. When cities can rely on external sources of food, including foreign aid, moreover, they also become refugee magnets—as Dhaka, Port-au-Prince, and Kinshasa have become. Sustained by the vast wealth of the wider world, these struggling megacities can expand without a surge in national prosperity.

Antiurban critics look at agglomerations of the poor like Port-au-Prince and despair at their filth, crime, and dismal living conditions—negative externalities of density. Over time, developing and developed cities have mitigated these effects with competent government and money, both of which poor cities lack. But sending people back to the even more impoverished countryside isn’t a viable option; there is no future in rural desperation.

The most fundamental—but also the most costly—job of city government is hygienic: securing safe water supplies. No crime wave can compare in horror with a cholera epidemic. Yes, urban density can help spread airborne epidemics, like the 1918 influenzas, or sexually transmitted plagues, like AIDS. But water is the great repository for bacteria, and waterborne killers are harder to check through quarantines and behavioral responses, like sexual abstinence. If human waste pollutes urban water supplies, the results can be deadly, as they were in London in 1854, when more than 125 people died of cholera near Broad Street over just three days, after drinking from a well contaminated by a sick baby’s diapers. A similar cholera epidemic ravaged Kinshasa, where sewers are basically nonexistent, just a few years ago, sickening hundreds and killing dozens over a short period of time. Port-au-Prince also has no sewers, which has undoubtedly worsened the cholera outbreak that has killed thousands of Haitians in recent years.

Clean water usually requires serious investment in infrastructure that brings water in from somewhere less dense and that ships out human waste so that it doesn’t infect water supplies. Large-scale infrastructure of this kind doesn’t just need good engineering; it needs capable government, which can eliminate corruption and incompetence and credibly borrow. During the 1990s, the city-state of Singapore solved its long-standing water-supply problem by creating a system that purified and reused water. Alarmists who are worried about supplies to American cities forget about the world’s salt water, which can be desalinated at a cost of $1 to $1.50 for 1,000 gallons—more than twice the typical daily use of an American family. At present, Kinshasa and poor cities like it couldn’t come close to affording such innovative ways of providing clean water. Looking to nineteenth-century New York City might provide a more practicable approach. Those New Yorkers, like the ancient Romans before them, built sewers to move waste away from the people and aqueducts to bring fresh water to them from a less dense area. Rome moved its waste into the Cloaca Maxima; New York dumped it into the East River. The waste areas were doubtless disgusting. No one had to drink from them, though, because pure water was readily available.

In old New York, the model that worked was a public entity—but one set up to be independent from the morass of corrupt city government. That may be the right model in much of the developing world today, too. New York originally tried to secure clean water by contracting with a private company, founded by Aaron Burr in 1799. The firm agreed to provide the water—if it could do a bit of banking on the side. Burr’s Bank of Manhattan Water Company evolved into Chase Manhattan Bank and then JPMorgan Chase, making huge profits in finance, but it never was any good at water provision. Somewhat later, the Water Works Company, another private New York firm with a charter to supply water to the city, failed miserably. It couldn’t raise enough funds for the infrastructure it needed to tap the Bronx River and some local ponds and was plagued by charges of financial mismanagement, which spooked its stockholders.

New York eventually solved its water problem with the construction of the 40-mile-plus Croton Aqueduct, completed in 1842, which delivered pure flows from the Croton River southward into the city. The aqueduct was built not by ordinary city government but by an independent group, set up by the state: the Water Commissioners. In a sense, the arrangement prefigured Robert Moses’s ambitious New York infrastructure operations in the next century.

This type of entity has some real advantages when city governments are corrupt. Public but independent, its separate, well-defined mission means that it can be held more accountable for its performance, especially if placed under strong individual leadership. Its accounting books, kept separate from those of other city entities, can be more easily audited. And if the entity is long-lived, it can think on a city-building time scale, not from election to election. Such entities have also established a good track record of attracting talented individuals to lead them. The model isn’t perfect, it’s important to add. Moses illustrates both the strengths and weaknesses of this approach, as he was capable and honest—but also prone to ignoring the concerns of many voters. Still, the independent-but-public model worked in providing New York City with clean water. After building the Croton Aqueduct, New York then turned to the expansion and improvement of its sewers.

If the aqueduct was New York’s signature water-infrastructure project, reversing the flow of the Chicago River was Chicago’s even more amazing nineteenth-century feat, ensuring that waste no longer polluted Lake Michigan, the source of the city’s drinking water. The work of economic historian Werner Troesken documents the tremendous health gains that came from municipal water provision in the U.S. a century or so ago.

Large-scale public works like these are expensive: America’s cities and towns were spending as much on clean water at the start of the twentieth century as the federal government spent on everything except the post office and the army. Research by David Cutler and Grant Miller suggests that these outlays were possible only because financial markets had come to trust cities enough to lend them millions of dollars—underscoring again the importance of competent government. But relying on private interests for clean water, which didn’t work in nineteenth-century New York, would be even less likely to succeed in the new cities of the poor. First, the truly destitute will rarely pay a premium for fancy water, so private providers are unlikely to make enough money to undertake such a project. And as Yale’s Eduardo Engel has shown, public-private infrastructure “partnerships” have worked well in relatively well-off Chile; but in poorer places, they often become an excuse for theft—either by the government of the private firm or by the company of the government.

Corruption undermined New York City’s street-cleaning efforts during its poorer nineteenth-century past. In the days of Boss Tweed and Tammany Hall, the city government would hire private contractors to do the job, but the cleaners did little and kicked some of the money back to corrupt officials, who looked the other way. The streets became dramatically cleaner when the city hired public street cleaners, famously led by the meticulous George Waring.

When governments are more honest, turning to private contractors can make sense. The switch from public to private services in many wealthy, relatively well-functioning cities in recent decades has often produced significant savings, with little or no reduction in service quality (and sometimes service improvement). But if places like Port-au-Prince or Kinshasa are to make their water supplies safer, some kind of public entity will probably have to lead the way in building the required infrastructure—and should be encouraged to do so by external pressure. The business will be dirty and costly but not as dirty and costly as recurring waterborne plagues.

If clean water is the first job of city government, then reducing crime is job number two. As the New York Times recently reported, 2013 was Karachi’s deadliest year ever, with 2,700 people murdered and kidnappings, robberies, and other heinous crimes running equally rampant. Kinshasa is incredibly violent, with a murder rate estimated as high as 112 killed per 100,000 people (New York’s rate is four per 100,000). Caracas’s murder rate is also more than 100 per 100,000.

Policing in these cities is ineffective and notoriously corrupt. (Asia’s poor slums are often comparably safe because they haven’t lost the nongovernmental sources of safety that urbanist Jane Jacobs described. When you enter a slum in Mumbai—a megacity with a booming economy and high levels of poverty—you don’t feel threatened, despite the fact that there’s not a cop to be seen. You feel the eyes of the neighborhood watching, making sure that you don’t pose a threat.) Thankfully, fighting crime doesn’t require fancy technology or abundant resources. It can be done on the cheap, even from the highest levels of society, as Singapore’s history shows. Singapore is known today for its honest public officials and safe streets, but that wasn’t the case when a then-poor island became independent 50 years ago. Singapore had a strong leader, Lee Kwan Yew, as prime minister for its first three decades of independence, however, and he early on imposed tough penalties against crime and disorder (including caning, even for nonviolent offenses) and cracked down on corruption, without worrying much about proof—any cop with an inexplicably high level of wealth could go to jail. Lee’s methods would offend any civil libertarian, but they helped transform Singapore’s culture in ways that fueled the city-state’s remarkable rise, reminding us that a trade-off can exist between authoritarianism and disorder. I enjoy living in a country where charges against policemen, or anyone else, require solid evidence to convict, but that may be a luxury of an ordered society. If crime and corruption are raging out of control, as they are in some of the cities of the poor, tougher approaches may be necessary.

New York City’s history of crime prevention provides a second lesson for the poor cities. When Theodore Roosevelt was New York’s police commissioner, the fight was against laziness and corruption. Recent commissioners William Bratton’s and Ray Kelly’s terms teach many lessons, but most important may be the imperative of reclaiming public space. In 1993, Mayor Rudolph Giuliani and Bratton launched their proactive, data-driven, crime-fighting revolution, which achieved breathtaking gains and eventually made the city the safest big metropolis in America. One aspect of that revolution was shutting down open-air drug markets like the one that operated in Alphabet City in downtown Manhattan. Pushing drug sales off the streets and out of the parks didn’t eradicate drug use in New York; in a big American city, it’s always easy to find a dealer willing to make a private sale. But shifting from public market to private dealer turned out to have a positive effect on the level of violence in the city. Between 1993 and 2012 (with Mayor Michael Bloomberg and Kelly continuing the Giuliani-Bratton policies), the number of murders in New York’s Ninth Precinct, which includes Alphabet City, fell by a stunning 94 percent. Not all this turnaround resulted from the ending of public drug sales, but the new policy clearly made a significant difference. In recent years, Rio de Janeiro—still a violent place, by New York standards—followed a similar strategy of pushing drug sales out of public places, and it, too, has become much safer.

To understand what happened in these cases, my sometime coauthor José Scheinkman’s metaphor about markets and crime is useful. With the “dentist” model of product distribution, in Scheinkman’s formulation, customers have a specialist whom they know and trust to some degree—in the case of illegal drug sales, a friend or an acquaintance who also deals. The “grocery store” model requires customers to come to a specific location, where they know they can buy the product—the old Alphabet City for drugs—and they usually don’t know or care who is selling to them. From a policing point of view, the two models are completely different. Open public markets where dealers meet anonymous clients are relatively easy to eliminate: the dealers can be arrested, and buyers scare easily when faced with the threat of jail. Eliminating the dentist model of illegal drug distribution is much tougher, requiring a lot more investment of time and resources, because the supply chains are hidden and locations aren’t fixed.

The grocery-store model also generates far more violence. A rival seizing a known drug market takes over both the turf and its regular business—which explains why the gangs of Rio de Janeiro’s favelas were constantly warring over real estate. By contrast, the killer of a drug “specialist,” doing his business behind doors, doesn’t automatically inherit his customers, so there’s not the same incentive to violence. When Rio’s police adopted the strategy of fighting the “grocery stores” but leaving the “dentists” alone, drug trafficking went underground. That may not have had a huge impact on illegal drug consumption in the city, but rival traffickers stopped attacking one another over turf.

For poor cities, the implication is clear: cheap policing can be effective as long as it is smart and doesn’t make the perfect the enemy of the good. It isn’t going to be cost-effective to try to eradicate the entire drug trade in Kinshasa anytime soon, but targeted interventions against public drug markets don’t demand time and resources in the same way.

New York’s third lesson for the developing world is that urban housing problems need pragmatic government that encourages private-sector solutions over idealistic gestures. Housing becomes affordable when private developers can earn a profit delivering greater density. Yet too many developing-world cities have failed to protect private property from expropriation by squatters and have aggressively regulated the development of new dwellings. Ideological opposition to the development of private property makes it difficult to deliver housing that would materially improve the lives of the world’s urban poor.

In the West, legal protection of land rights long preceded major restrictions on new development. While private contractors didn’t do a great job of delivering clean water to New York sewers, their extraordinary successes as developers and builders can be seen in Manhattan’s aboveground structures. The developers had two powerful legal assets lacking in many developing cities today: their land was well protected from private expropriation by squatters or other parties seeking possession; and their building activities were relatively unhindered.

Historian William Novak reminds us that nineteenth-century America was not a laissez-faire paradise but a place where localities imposed scores of rules on property owners. Typically, these restrictions were motivated by real concerns, such as the fires that can engulf wooden houses. But in New York, unlike in Boston, these early regulations didn’t prevent building up. New York’s landmark 1916 zoning ordinance was in place when the Empire State Building rose on the former Waldorf-Astoria site, but its constraints were minimal: it only required that the building narrow slightly as it rose, so that light could still hit the streets. Today, of course, the city is blanketed with far more intrusive zoning and historic-preservation rules, which would deter anyone seeking to add significantly more height to old Astor properties. (See “Preservation Follies,” Spring 2010.) These rules cost New York by limiting the supply of real estate and ensuring that prices are higher than they need be, but they were instituted too late to prevent the growth of a great, densely packed city, which had lots of low-cost buildings that could be rebuilt over the years, as people got wealthier and their needs changed. It is that density that makes New York a walking city, where it is easy to stroll to an eatery or meet someone for coffee. Just imagine if Fifth Avenue’s property owners had managed to get their way a century ago and blocked the redevelopment of Gilded Age mansions into skyscrapers.

Since the protection of property from private theft is so well accepted in the West, it’s easy to assume that only two choices exist: small-government places, like twenty-first-century Texas and nineteenth-century New York, where property is protected and lightly regulated; and big-government places, like California and New York today, where the government protects land against everyone except itself and imposes extensive limits on what private owners can do with their property. Regrettably, land policies in today’s cities of the poor offer a more destructive paradigm: they manage to combine lawlessness with stifling government regulation. In many of these cities, the government does not protect private property against private expropriation. If squatters come to occupy a private landowner’s property, the government is unlikely to expel them. The political fallout from using force to evict the poor—even those who have illegally occupied private property—is simply too high. Yet the government often tightly limits what can be built, at least in formal dwellings. For decades, central Mumbai labored under the requirement of a maximum floor-area ratio of 1.33, an extremely intrusive regulation that limits building upward and helps ensure that high-end Mumbai real estate is now among the most expensive in the world—a remarkable fact, given the high level of poverty in the city. The skyscrapers that do exist are surrounded by lots of green space, to satisfy land-use rules, but this means that no one can walk anywhere. All this regulatory intervention is incongruous in a city that can’t stop squatters from occupying airport runways.

This combination of overpowering regulation and weak property rights, common in the cities of the poor, ensures underdevelopment. The failure to safeguard private property makes building excessively risky, unless the owners are willing to use violence to clear their land. The risks are compounded by the hoops that the regulators make developers jump through. Development gets skewed toward permanent, defensible space—the kind that passes muster with every regulation, like expensive gated structures for the wealthy—and away from cheap, transitional housing. Populist attempts to regulate developers and protect squatters have the perverse effect of discouraging the construction of these simple dwellings—precisely the kind that poor cities need. If the poor cities ever begin to grow economically at reasonable rates, then any housing appropriate for their residents in 2014 will be wildly inappropriate for their successors in 2053—because incomes should have risen substantially in 40 years. Poor-world cities need low-cost, temporary buildings that can be rebuilt over time, just as the Astor properties were.

These reforms—infrastructure for clean water, effective policing, a sensible system of property rights—would bring huge improvement to the lives of the poor in burgeoning cities like Port-au-Prince or Kinshasa. Their costs would vary from a lot, by poor-city standards (water infrastructure), to a little (changing property rules). But all demand the kind of competent political leadership rare in the world’s new cities of the poor. The history of the West, however, reminds us that cities, as wellsprings of political change and reform movements that curb corruption, are often their own best saviors. We must hope that the political and economic changes that emerge from urban agglomerations will reduce the risks inherent in the world’s rapid urbanization.

Top Photo: Refugees are flocking to Third World cities like Dhaka, where the population has swelled to 15 million inhabitants. (MAJORITY WORLD/UIG/BRIDGEMAN ART LIBRARY)