The Pakistani Army offensive against the Taliban has had some interesting side effects. For one thing, Afghan refugees (from the 1980s and 90s) have suddenly changed their minds about living in Pakistan. In the last month, over 22,000 of these Afghans have returned to Afghanistan. Not because things are all that peaceful and well in Afghanistan, but because the battles between the Pakistani Taliban and the army have made life unpleasant. Currently, over a thousand refugees a day are applying for UN assistance to return home. There are over two million Afghan refugees still in Pakistan. That many have already returned to Afghanistan since 2002. Those who remained had settled down and didn't want to move. Several efforts by the Pakistani government to persuade the Afghans to go home, have failed.
Some 200,000 Afghan refugees are living outside the tribal territories (along the Afghan border), in Sind and Punjab, and are often involved in criminal and terrorist operations. Many of these Afghans are in major cities, like Karachi, where some provide support for Islamic terrorists. Pakistan would like all the illegal Afghan refugees to go home, but many have fit right in with legitimate and criminal activities.
Afghanistan has had a hard time taking back all the refugees. After the Taliban government fell in late 2001, there were six million Afghans in exile in Iran (two million) and Pakistan (the rest). Since then, Afghanistan has taken so many of these refugees back, that the returnees caused a population increase of over 20 percent. Despite billions of dollars in international aid, it's been hard absorbing that many people.