The coming decades will see the next wave of mass migration to cities, especially in Asia and Africa. Megacities are sprouting while entirely new cities are being created. Cities, with their economies of scale, scope and connectedness, bring people and markets together in a single, dense space. They will be one of the driving engines of growth, poverty reduction and prosperity over the course of this century.Yet several cities are struggling to retrofit services and infrastructure amid chaotic growth, from the favelas of Brazil to the tugurios of Colombia and the shanty towns of Africa. Many cities in developed countries, such as Detroit, are struggling with ageing populations and the loss of their industrial base since manufacturing has moved to other venues and automation has wiped out unskilled and semi-skilled jobs.The World Economic Forum City Competitiveness Report identifies six global megatrends that are likely to determine how well cities do in the future.1: Urbanization, demographics and the emerging middle classPeople have moved from the countryside to cities for millennia, but never before have urban spaces grown at the speed and scale they are today. As of 2010, for the first time in history, more than half of the world’s population lives in cities. Cities account for over 80% of global GDP. According to the UN, an extra 2.4 billion people will live in cities by 2050, bringing the global sum of city dwellers to 6.3 billion – 67% of the world’s population.For the foreseeable future, rapid urbanization will be almost exclusively a non-Western affair: about 94% of those who move to cities in the next few decades will come from the developing world. The emerging-market middle class will double its share of global consumption (from a third to two-thirds) by 2050.Ageing will also be a key trend in global demographics. By 2050, one in every five people will be at least 60 years old. The overall ratio of old to young is set to almost double from current levels.2: Rising inequalityCities are affected by rising inequality and, in some instances, may help cause it. Rapid urbanization in the developing world inevitably increases the gap between cities and small towns/rural areas. Will a city-based global economy “pull up” non-urban hinterlands, or will cities become rich enclaves surrounded by marginalized backwaters?3: SustainabilityGiven their concentrations of people and economic activity, cities are especially intensive in their use of energy, food and water. They are responsible for more than half of global greenhouse gas emissions. Their challenge, especially in the developing world, is to fuse technology and markets to become much more efficient in their use of available resources.4: Technological changeTechnological change is “disruptive”. Automation and globalization have shifted a lot of manufacturing (and the jobs related to it) to developing countries. This is now happening with clerical jobs in many services industries. Cities remain best placed to take advantage of technological change, whether incremental or disruptive, which allows them to access global markets, discover new opportunities in education and training, improve healthcare, store and use big data, and much else besides.5: Clusters and global value chainsMultinational companies are the “system integrators” of global value chains. Cities compete to host corporations of this sort – for global headquarters operations, regional HQ operations and as foreign subsidiaries. In future, there will be more next-generation large companies looking to locate their HQs and subsidiary operations. Many of these will come from China and other emerging markets, and offer opportunities for cities to become more important in global value chains.6: GovernanceIn stark contrast to dynamic economic, social and technological forces, the world of politics and governance seems static. The Westphalian system of nation states still predominates, almost five centuries on. But global governance remains weak. This creates a window of opportunity for provincial and city governments to rise and shine.Led by urbanization, they condition the environment for cities around the world. It is up to cities to take advantage of these megatrends, as well as to mitigate negative forces such as rising inequality, pressure on natural resources and the environment, and a diminution of trust in public authorities. The question now is how cities can adapt to these challenges and continue to prosper.The article and video were first published in the World Economic Forum Blog (http://forumblog.org/) on 14 August 2014.