This is a worldwide trend, not just in the Western World. In general, because those societies tend to be wealthier than others around the world, they are more of a magnet for immigrants, and many of those immigrants (who used to find work in the agricultural industry) now find jobs in the service and manufacturing sectors. These jobs, of course, are mostly found in larger cities.
We can also attribute the growth of the cities to the simple fact that world population has continually grown. So the population has risen everywhere, including in the cities. As it has risen in countries with less well developed economies, it has driven more people to leave their nation and immigrate to a Western country with more opportunity.
Cities have grown so much because the more rural areas can't, or at least aren't, sustaining their current populations. People have to move where the jobs are. Rural industries, such as agricultural pursuits, have shifted from smaller, family-owned operations to conglomerations which require fewer workers and certainly limit those who want to work for the love of the land. Non-agricultural enterprises need to be near population centers to find their work forces.
Cities have also grown because of a lack of services in less-populated areas. Medical facilities and expertise can generally only be found in larger population centers. Wireless phone, cable, and internet services are not always consistently available in the more remote rural areas. Cultural opportunities generally flourish in the city environment. All of these are strictly financial issues; services must be cost-effective to turn a profit, and the smaller numbers prohibit cost-effectiveness outside of larger cities.
Life in the city, while it certainly has its trade-offs, is often more convenient to shopping and entertainment and transportation and all the other things which take more time and effort in the more rural places.
I'm certain there are plenty of other reasons for this pattern of migration, but this should help you get started.