Its their doing. Its USA and UK who is in Afghanistan and put a gun on Mussaraf's head to fight against Afghan people ,with whom Pakistanis had no prior qurrel, causing worst kind of terrorism,instability and chaos on Pakistani soil.
USA could seal the Afghan/Pakistani border from Afghanistan side without involving Pakistan because USA / UK did not want to commit their forces and take up the casaulties. They rather have their men drink and watch porno movies inside secure military basis at night instead of watching the border. This was left to 80,000 Pakistani forces posted on the Pakistani / Afghan border.
Pakistan had to put up with influx of millions of Afghan refugees ,providing food and other community services on daily basis for years.