Really? I've already explained how, but if you're such a child that you need me to explain in a bit more detail, here: Afghanistan's refusal to accept Pakistan and the border led to tensions between the two. Afghanistan tries to take the Tribal area twice, and funds separatists in Pakistan, leading to Pakistan closing the border, forcing Afghanistan's economy to it's knees. Afghanistan invites India and the USSR for help, the USSR takes advantage and pushes a communist government in Afghanistan, leading to the US getting involved. The subsequent war destroy's Afghanistan, and warlords take over; the country is (once again) divided on tribal lines. A massive one fifth of Afghanistan's population relocates to Pakistan as refugees. Pakistan's economy loses billions trying to support the refugee crisis. Seeing the taliban making major gains, and desperate to stabilize Afghanistan, Pakistan supports the taliban and very nearly succeeds in bringing stability to the country. Ahmed Shah Masood (in a desperate attempt to reclaim Kabul) invites OBL to Afghanistan to join forces, but OBL is captured by taliban forces as soon as he arrives. OBL joins the taliban, against ASM. 9/11 happens, and the US invades Afghanistan, propping up warlords into the new government. Bush jr threatens Pakistan into joining the war on terror, Pakistan accepts reluctantly, which leads to Pakistan very nearly going backrupt, and causing massive amounts of extremism to rise.
And the rest is pretty much self explanatory.
Oh, I agree to an extent. The thing is, Pakistanis are more than willing to move on, it's the Afghan side that isn't. As soon as Afghanistan recognizes the border between the two, the war will become much easier for Afghanistan to fight. Pakistan has been wanting to build a security wall between the two nations, so as to slow down the flow of militants.
The thing is, Afghanistan refuses to do it for two main reasons:
1. Afghanistan is stuck in the past, and continues to demand Pakistan give up a majority of it's territory to Afghanistan.
2. Afghanistan wants a scapegoat, so as to have some sort of unity among the population. As long as Afghanistan refuses to accept the border, it can continue to claim that there are militant sanctuaries in Pakistan (even after Zarb e Azab). This is despite the fact that Pakistan has over a thousand check posts on the border, many of which come constantly under attack from Afghanistan's side of the border; meanwhile Afghanistan barely has a hundred check posts.
If the border is accepted, and the wall is built, Afghanistan's war will be over pretty quickly.