This question is vague and could be approached from a number of angles. I would argue that one of the most significant examples of rural-urban migration in history is provided by the industrial revolution, which began in Great Britain in the early to mid-19th century before spreading to France, the rest of Western Europe and the United States. The emergence of major industrial factories in cities, and in many cases the springing up of new cities around such factories, led to a dramatic alteration in the way of life of the entire population. Not only were large numbers of people drawn to urban areas to take advantage of job opportunities, but the way of life for those in the country was severely undermined. The manufacturing economy that had existed in England, for example, where workers and their families would produce goods in a cottage or small community, was largely undermined by technological advances and the superiority of factory production in terms of efficiency.
Industrialization has had a similar impact in other parts of the world in more recent times, such as in China. In fact, many see the current rate of urbanization as unprecedented. The total number of people living in urban areas is expected to grow from 3.4 billion to 6.3 billion by 2050. That being said, there is an urban-rural component to migration as well, as this question suggests. One cause of this is the cost of living in cities. In many large urban areas, property prices and other necessities for life have risen dramatically, meaning rural life offers an affordable alternative. This can be particularly attractive to families, for example, who are considering the quality of life for their children. A desire to contribute to the improvement of biodiversity and the environment also plays a role among some urban-rural migrants (see the story about Daniel and Johanna at the link below). Other reasons can be more immediate. The United Nations University notes the example of the response by 600,000 residents of the Haitian capital Port au Prince to the 2010 earthquake. As a result of the collapse of food supply systems and other services, they left the city for the country’s rural areas in order to survive. A final reason worth mentioning here is technology. The rapid spread of the internet and other forms of communication means that people who want to live in rural areas can still stay connected with work and educational opportunities or with friends or family in urban centers.