By Charles Kenny

There is something viscerally repulsive about slums: the stench of open sewers, the choking smoke of smoldering trash heaps, the pools of fetid drinking water filmed with rainbow chemical spills. It makes poverty in the countryside seem almost Arcadian by comparison. The rural poor may lack nutrition, health care, education, and infrastructure; still, they do the backbreaking work of tending farms in settings that not only are more bucolic, but also represent the condition of most of humanity for most of history. With life so squalid in urban slums, why would anyone want to move to one?

Because slums are better than the alternative. Most people who have experienced both rural and urban poverty choose to stay in slums rather than move back to the country. That includes hundreds of millions of people in the developing world over the past few decades, and 130 million migrant workers in China alone. They follow a well-trodden path seeking a better life in the bright lights of the city; think of Dick Whittington, the 14th-century rural migrant who ended up lord mayor of London.

The good news is that the odds of living that better life are greater than ever. For all the real horrors of slum existence today, it still usually beats staying in a village.

Start with the simple reason most people leave the countryside: money. Moving to cities makes economic sense. Rich countries are urbanized countries, and rich people are predominantly town and city dwellers. Just 600 cities account for 60 percent of global economic output, according to the McKinsey Global Institute.

Slum dwellers may be at the bottom of the urban heap, but most are better off than their rural counterparts. Although about half the world's population is urban, only a quarter of those living on less than a dollar a day live in urban areas. In Brazil, for example, where the word "poor" conjures images both of Rio's vertiginous favelas and of indigenous Amazonian tribes, only 5 percent of the urban population is classified as extremely poor, compared with 25 percent of those living in rural areas.

But is much of a life eked out in today's urban squalor? Our image of modern slums comes from films like Slumdog Millionaire and books like Katherine Boo's Behind the Beautiful Forevers, portraits of India's urban underclass not that far removed from the horrifying picture of 19th-century industrialization in Charles Dickens' novels about the misery and violence of London's slums. A recent commentary in the New England Journal of Medicine called urbanization "an emerging humanitarian disaster." And in Planet of Slums, urban theorist Mike Davis wrote, "No one knows whether such gigantic concentrations of poverty are biologically or ecologically sustainable."

Actual living

But slum living today, for all its failings, is markedly better than in Dickens' time. For one thing, urban life now involves a lot more actual living.

Throughout most of history, death rates in cities were so high that urban areas maintained their population levels only through constant migration from the countryside. In Dickensian Manchester, for instance, the average life expectancy was just 25 years, compared with 45 years in rural Surrey.

Across the world today, thanks to vaccines and underground sewers, average life expectancies in big cities are considerably higher than in the countryside; in sub-Saharan Africa, cities with populations of more than a million have infant mortality rates a third lower than those in rural areas. In fact, most of today's urban population growth comes not from waves of villagers moving to the city, but from city folks having kids and living longer.

The better quality of life is partly because of better access to services. Data from surveys across the developing world suggest that poor urban households are more than twice as likely to have tap water as those in rural areas, and they're nearly four times more likely to have a flush toilet. In India, very poor, urban women are about as likely to get prenatal care as the non-poor in rural areas. And in 70 percent of countries surveyed by MIT economists Abhijit Banerjee and Esther Duflo, school enrollment for girls ages 7 to 12 is higher among the urban poor than among the rural poor.

That said, modern slum dwellers, who make up about a third of the urban population in developing countries, are among the least likely to get vaccines or be connected to sewers. That means ill health in informal settlements is far more widespread than city averages would suggest. In the slums of Nairobi, for example, child mortality rates are more than twice the city average, and higher, in fact, than in Kenya's rural areas.

Force for good

But Nairobi's slums are atypically awful, more an indicator of the Kenyan government's dysfunction than anything else. In most developing countries, even the poorest city dwellers do better than the average villager. Banerjee and Duflo found that among people living on less than a dollar a day, infant mortality rates in urban areas were lower than rural rates in two-thirds of the countries for which they had data. In India, the death rate for babies in the first month of life is nearly a quarter lower in urban areas than in rural villages. So significant is the difference that population researcher Martin Brockerhoff concludes that "millions of children's lives may have been saved" in the 1980s alone as a result of mothers moving to urban areas worldwide.

Slum life remains grim. HIV prevalence is twice as high in urban areas of Zambia as in rural areas, for instance, and the story is worse with typhoid in Kenya. Slum residents also face far greater risks than their rural counterparts due to violence, outdoor air pollution, and traffic accidents. And the closer conditions in slum areas get to a state of anarchy mixed with kleptocracy, the more health and welfare levels tend to resemble those of Dickensian Manchester.

But all things considered, slum growth is a force for good. It could be an even stronger driver of development if leaders stopped treating slums as problems to be cleared and started treating them as populations to be serviced, providing access to reliable land titles, security, paved roads, water and sewer lines, schools, and clinics. As Harvard economist Edward Glaeser puts it, slums don't make people poor; they attract poor people who want to be rich. So let's help them help themselves.

Charles Kenny is a senior fellow at the Center for Global Development, a fellow at the New America Foundation, and the author, most recently, of "Getting Better." He wrote this for Foreign Policy.