Medellín is a big city tucked into a river valley and overflowing onto the surrounding hills. In the 1970s-1990s, violence in the countryside pushed millions of people out of their homes and into the city. They settled in free/cheap land in the hillsides and formed communities that tended to be poorer and more violence ridden.
But the city became more integrated in the 1990s with the completion of the metro system (the only one in Colombia!). The metro connects the poorer communities in the North with the wealthier communities in the South. It also includes a network of cable cars, which make it easier for people to go up and down the hills.
Now, riding the cable car is one of the top tourist attractions of the city. The stacked brick houses may have been built under unfortunate circumstances, but they still make for a most spectacular view.