Crime, congestion and pollution mar all cities, from Los Angeles to Mumbai. But another force trumps the drawbacks of urban living: cities bring opportunities for wealth and for the creative inspiration that can result only from face-to-face contact with others. In fact, the crush of people living in close quarters fosters the kind of collaborative creativity that has produced some of humanity's best ideas, including the industrial revolution and the digital age. In the years ahead such collaborations can be expected to help solve the world's most pressing problems—poverty, energy shortages, climate change—and to promote the type of fundamental political transitions seen in Cairo that astonished the world in 2011.

Why do cities bring out the best in us? Technology lets us hold virtual meetings, and the Internet keeps us in touch 24/7, but neither can be a substitute for the social cues—such as a facial expression signaling comprehension or confusion—shared when people meet in an office, bar or gym. Cities deliver the random exchanges of insight that generate new ideas for solving the most intransigent problems. [For more on this mechanism, see “Bigger Cities Do More with Less,” by Luís M. A. Bettencourt and Geoffrey B. West, on page 106.] Young workers, whether they are on Wall Street or in Google's New York City offices, succeed by picking up unexpected bits of knowledge from the successes and failures of those around them. It has always been so.

Think of the chain of brilliance that spread throughout the towns of 18th-century England and brought us the industrial revolution. The crucial technology for spinning with rollers started with Lewis Paul and John Wyatt in Birmingham, passed to John Kay and Thomas Highs, and then ended in the hands of Richard Arkwright, thanks to a discussion over a few drinks outside of Manchester. By supercharging the flow of ideas, cities foster economic prosperity, innovation, better health—and even new ways to govern ourselves.

A Superhighway of Ideas

The constant interchange of ideas has helped cities throughout the developing world find a pathway out of poverty and into prosperity. Average incomes reach a level more than five times higher in countries that are mostly urbanized compared with those in which most of the population stays in the countryside. Across districts in India, mean individual earnings increase by about 20 percent as density doubles, even when individual age and education are constant.

As hubs of global commerce, cities also facilitate integration with the world economy. People in developing nations can become prosperous if they can sell their time—transformed into goods and services—to wealthy markets. In essence, cities connect poor countries with rich markets.

One example is telling. N. R. Narayana Murthy, one of the billionaire founders of Indian software giant Infosys, graduated in the 1960s from the University of Mysore and the Indian Institute of Technology Kanpur, but in those years an Indian engineering degree could not guarantee a high income. Murthy started working at Patni Computer Systems (later bought by iGate), whose founders had lived in the U.S. and understood how to work with the American appetite for software. The founders took their knowledge back to India and, joined by Murthy, set up a back-office operation in Pune to serve U.S. companies, thereby linking Indian talent and American markets.

In 1981 they started their own software company and netted their first U.S. client in 1982. A year later they moved to Bangalore to work with a German spark-plug producer that wanted Infosys nearby. About 30 years on, Infosys is a flat-world phenomenon that has made billions of dollars for its founders and has trained thousands of Indians in Bangalore, helping them to become more prosperous by selling their engineering talents worldwide. That success has also rippled through the food chain in Bangalore to the service providers in local restaurants and taxis, which translates into jobs for thousands of other Indians.

Another small-world sensation emerged not far from Hong Kong. Shenzhen had little industry before 1980, when the People's Republic of China made Shenzhen its first special economic zone intended as a magnet for foreign investment in manufacturing. Tax breaks and exemptions from trade regulations encouraged such investment. Manufacturers were drawn by the opportunity to make goods with inexpensive Chinese labor; workers came because factory jobs offered far more economic opportunity than life in rural China. Pepsi was the first American company to move into Shenzhen in 1982, bottling soda for Hong Kong consumers at a fraction of Hong Kong wages. Other international companies followed, making toys, handbags, sneakers and, ultimately, more sophisticated products. Today the area has more than 10 million people, and the McKinsey Global Institute, McKinsey & Company's economic and research arm, predicts that it will be the world's 10th-largest urban economy by 2025.

Healthy Ideas

Cities can breed health as well as wealth. Life expectancy in New York is now more than two years higher than the national average. It is not entirely clear why older New Yorkers are healthier. Some people credit walking; others talk about social connections made possible by density. But among younger people, the reasons are no mystery. Motor vehicle accidents and suicides are two primary killers of people younger than 35 years, and both are far less common in cities. In New York City the death rate from motor vehicle accidents is more than 70 percent lower than in the country as a whole. Taking the subway after a few drinks is just a lot safer than driving drunk.

Cities can also make humankind healthier by producing knowledge. John Snow, a founder of epidemiology, had his great breakthrough in 19th-century London, when the city itself provided the information he needed to understand cholera. By studying the urban map of a cholera outbreak, he was able to connect the disease to a water pump and grasp the connection between polluted water and infection. More recently, early breakthroughs in AIDS occurred when Parisian researchers perceived the pattern of infection within that city. The knowledge that cities can provide is often the best weapon against disease.

The cities of the developing world are not yet healthy, in part because their governments have been unable to provide the basic infrastructure that cities need. Still, cities themselves may supply their own solutions. Often they are where the seeds of revolution against bad government sprout, and living contiguously facilitates the coordination that enables citizens to create reform movements that rise up and oust dictators. Urban uprisings do not always end in stable democracies, but most stable democracies benefited at some time from an urban uprising.

Europe's first modern republic—the Netherlands—had its roots in centuries of popular rebellions in the wool-making towns of Flanders, such as Brugge. In the central square of Brugge stands a statue of a weaver and a butcher, urban artisans, who are celebrated not for their crafts but because they helped to organize their fellow guild members in the fight against French royal rule. On May 18, 1302, they organized an urban insurrection, now called the Brugge Matins, and massacred the French knights occupying their town. Almost two months later Brugge's disciplined artisans and their allies demolished the flower of French chivalry at the Battle of the Golden Spurs.

These victories did not produce a republican government for centuries, until the fire of the Reformation, which had spread across the cities of northern Europe, added an extra religious reason to rebel. In 1556 the Low Countries had passed into the hands of the Spanish Hapsburgs, who attempted to tax and regulate these urbanites. Cities once again managed to coordinate action: first, an orgy of iconoclasm and then full-fledged revolt. The uprising took decades, and Flanders itself remained part of Spain, but the end result was an urban republic—the Netherlands—that became the center of a global empire of trade and conquest and a model for many republics to come.

The U.S.'s own uprising had its start in the dense corridors of 18th-century Boston, which connected revolutionaries-to-be such as Samuel Adams and John Hancock. Hancock had a commercial interest in getting crowds to agitate against British mercantilist policies; Adams knew how to conjure a crowd. Together they and their Bostonian allies—John Adams, Paul Revere and many others—became the nucleus of a fight for popular sovereignty.

The Facebook Revolution

The ability of cities to spread ideas of freedom and to coordinate mass action has led to countless revolts since then, from Paris in 1789 to St. Petersburg, Russia, in 1917 to Cairo in 2011. The toppling of former Egyptian president Hosni Mubarak has been called a Facebook revolution, but he would not have left if people had just blocked him from their Facebook pages. They needed to take to Tahrir Square.

Humankind continues to confront enormous challenges, from endemic poverty to global warming, but the track record of our urban species makes me optimistic. I have enormous confidence in the ability of Homo sapiens to work miracles when people cooperate. Our greatest gift is our ability to learn from one another, to work together, to solve problems by leveraging our collective intelligence.

The new electronic media can facilitate that collaborative process, but so does the face-to-face contact that is made possible by the physical proximity afforded by cities. Cities have been solving our species' principal challenges for millennia, and they are likely to keep on doing so for centuries to come.