Dear Muhammad, urbanization and the emergence of informal built areas is a complex process that may not be reduced to a set of variables. It involves all aspects of the demographic transition, productivity gains in agriculture, a decreasing proportion of income spent on food (Engel’s law) and simultaneous shift in relative demand for rural to urban goods and services. In this transition process, large cities, with new opportunities steaming from agglomeration economies, become magnets for rural firms and households looking to increase their standard of living. The opportunity cost of living in large cities or in the influence zone of large cities is much greater than that of rural areas where there are relatively fewer economic opportunities. I strongly suggest reading Edward Glaeser ‘Triumph of the City’s chapter on ‘Slums’. While the answer is complex, if we want to reduce this to a few variables, I would start to look for wage differences and distance as a manifestation of these complex dynamics. Hope this helps!