Some have wondered why the War on Terrorism in Afghanistan is going so poorly (well, stagnate would be a better term) while the Iraq front has turned so well. The answer is Pakistan. Pakistan serves a base of operations, safe zone, and recurting ground for operations in the area.
The important thing to remember is the Taliban is not an Afghan insurgency but a Pashtun/Baluchi movement against whatever legal system they find themselves against. The legalities of Afghanistan-Pakistan mean nothing to the tribes. The Federally Administered Tribal Areas (FATA) of Pakistan is an anything goes ungoverned territory where tribes are allowed to govern themselves.
Recently things have changed for the worse. Not only is FATA a base for operations against the Coalition in Afghanistan, it has become part of the new Pakistani Taliban state. Pakistan has tried several half-hearted attempts to curb the Islamists like in the Swat Valley but mostly the Pakistanis seek "peace treaties" which leave the Taliban in charge. The morale-boosting Taliban victories continues with Pakistan ceding control of Hangu.
It is hard to solve the Pakistan problem. The most obvious answer is to invade the FATA to deny the Taliban safe-heavens. This would follow the Iraq Surge strategy. However, an act like this may collapse the nominally helpful Pakistani government or lead to the rise of an Islamists government. At the very least Pakistani solders would rush to fight against us. So for now we must be content with raids against the Taliban in Pakistan. Hopefully one day we may be able to have Awakening movements against the Pakistani Taliban. But unlike in Iraq where the terrorists were outsiders, the Taliban is representative of the local groups.
The geopolitics and military hurdles of the Pakistani Taliban impose huge problems for the War on Terrorism. They must be solved or this war will only end when we decide to give up and leave.