The Durand Line, AKA “the border between Afghanistan and Pakistan,” is one of those legacies of colonial times that everybody’s still, unfortunately, living with today. Named after the guy who dreamed it up, British Foreign Secretary for India (at the time) Sir Mortimer Durand, it was meant to fix the border between British India and Central Asia. India was, obviously, a British colony, while 19th century Central Asia was a place where Britain liked to toss around its influence, mostly to establish and enforce a frontier between India and the constantly expanding Russian Empire. The “Great Game,” the 19th century’s version of the Cold War, was all about divvying up Asia between Britain and Russia and drawing a boundary between the two empires. Durand was supposed to be the centerpiece of that effort. It was also meant to prevent another Anglo-Afghan war–the first two, in 1839-42 and 1878-80, had been costly affairs that really didn’t accomplish much–which it definitely did, uh, not.
Durand’s line followed the contours of the Hindu Kush mountains, though he was careful to draw it in such a way that it left the crucial Khyber Pass into the Punjab in British hands. On November 12, 1893, Durand and Abdur Rahman Khan (d.1901), the Barakzai Emir of Afghanistan, agreed to fix the line as the Afghan-India border. The problem, as we are well aware today, is that Durand’s line cut smack through the ancient (they’re attested in Herodotus) homeland of the Pashtun, and for good measure it also bifurcated the Baluch people to the south. Not great!
Durand’s mistake, which would be repeated by Mark Sykes and François Georges-Picot in the Middle East about 23 years later, was in assuming that a geographic feature that would be an insurmountable obstacle for your average European bureaucrat must ipso facto be an insurmountable obstacle for everybody. In Sykes-Picot’s case, they figured that the Syrian Desert must be impassable to anybody, without noting that Bedouin had been using it as a highway for centuries. For Durand it was the Hindu Kush, apart from the Khyber Pass, that he thought must have been a natural border even though Pashtun had been passing through the mountains regularly for millennia. Perhaps Abdur Rahman Khan knew better, but he was in no position to argue with the British since he actually owed his crown to them (one of the results of the Second Anglo-Afghan War)
The Great Game ended, for a while at least, with the signing of the Anglo-Russian Entente in 1907, which divided Iran into “zones of control,” set Afghanistan as a buffer zone between the Russian and British empires in Asia, and united the two powers in an alliance meant to check the rising power of Germany. But the Durand Line very quickly became a problem for Afghanistan, precisely because of what it did to the Pashtun. The Third Anglo-Afghan War (oops), fought in 1919, would determine whether the line would hold or Afghanistan would absorb the entire Pashtun region. Of course the line held, not because it works as a border but because the British military won a fairly easy victory. Afghanistan was forced to affirm Durand as its border with India–later Pakistan–but in 1949 the Afghan government repudiated the line and said it had been forced upon them back in 1893.
The Afghan government still refuses to accept Durand nowadays, though it doesn’t try to do anything about it. The official position in Kabul is that the “Afghan people” need to decide what Afghanistan’s borders should be. Pakistan (which presumably gets a say here as well) does accept the line, but it also notoriously has had trouble controlling its predominantly Pashtun areas in the north. The Pashtun mostly ignore the line, passing between Afghanistan and Pakistan as a matter of routine, using countless mountain passes that can’t possibly all be monitored.
During the Afghan-Soviet War, the porousness of the border was a real boon to people trying to, say, smuggle weapons and, I don’t know, foreign volunteer fighters into Afghanistan to aid the resistance. Later it was an asset for, hypothetically, any Pakistani intelligence agencies who might have been interested, theoretically, in supporting a student-led theocratic movement that eventually toppled Afghanistan’s post-Soviet government and took power for itself. Still later, it became a real headache for people trying to, I don’t know, defeat the Taliban and track down any well-known international terrorists they might have been harboring. These days people are still (at least in theory) trying to defeat the Taliban, whose ability to move people and things back and forth across the Durand Line (whether with Pakistani complicity or not) is still complicating that effort.
Pakistan suffers from the lack of a stable border as well, with various Pakistani Taliban-affiliated groups allegedly basing themselves in Afghanistan (whether with Afghan complicity or not) and carrying out strikes across the border in Pakistan. Both countries accuse one another of aiding these cross-border insurgent movements, and both are probably right. There are periodic border clashes between Afghanistan and Pakistan, too, especially when fighting between the Taliban and Afghan/NATO forces gets too close to the line. For example, there was this one in 2011 that killed a reported 42 Afghans and may have been an “accident,” but probably wasn’t. Islamabad has talked about building a wall along the border, which might help the security situation but is anathema in Afghanistan (because, again, of the Pashtun situation).