Squatters are homeless people who illegally occupy buildings to use as permanent shelter. Squatter settlements are formed when large numbers of squatters occupy a building or group of buildings. These settlements occur around the world for a variety of reasons. Economics are the biggest cause, but some squatters are anarchists who see squatting as a form of protesting.
Squatter settlements are most often formed by rises in the numbers of homeless people. The homeless people then seek shelter off the street in abandoned buildings. Some of the buildings may still have power and water, which causes the homeless to flock to the "free" resources. Additionally, squatters congregate in settlements to protect each other from those who prey on the homeless. Criminals will target homeless because they only carry cash and are reluctant to contact the police. Additionally, many homeless are also weak from poor diets and disease, so they are easier targets for criminals.
Anarchists believe that no government is legitimate, nor is any associated national market. Anarchists do not even believe in the concept of property. Anarchists will squat in abandoned buildings as a form of protest. Arguably, most "anarchistic" squatter settlements are just normal squatters who claim a political reason for their illegal acts. It is notable that anarchistic squatter settlements only occur in Europe, where anarchism is taken semi-seriously as a political ideology.
Some artists will squat in abandoned factories for the working room the buildings provide. Some real estate developers will actually encourage the formation of these artist squatters to gentrify an area and attract young urban professionals. When the real estate then becomes more valuable, the artists are forcibly evicted and trendy lofts are installed. Most artist colonies are in Europe where they are semi-tolerated in some municipalities. East Berlin became noted for its artist colonies after the fall of the Iron Curtain.
In some countries there is a rigid religious caste system that brands people as "untouchable." These individuals are then forced to live on the fringes of society, with little opportunities for work. The untouchables will squat in abandoned buildings for shelter and to protect themselves from attacks. Often the squatter settlements are located near trash dumps, where the untouchables can make money by sifting through the trash for recyclables.