British reach Kabul through the Bolan pass with their Army of Indus to remove Dost Mohammad and install Shah Shuja. They occupy Afghanistan but that's when the real fight begins. They fail to ensure their control over Afghanistan. The Army of Indus is destroyed and the British send their Army of Retribution to retake Kabul, only to re-install the ruler who ruled before the British intervention. Dost Mohammad is back on the throne of Afghanistan, with British backing.
How history rhymed again in 21st century Afghanistan.
The Second Anglo-Afghan War (1878–1880) was fought as part of the Great Game rivalry between Britain and Russia over influence in Afghanistan. The British invaded Afghanistan with around 40,000 troops in three columns, capturing key locations like Kandahar, the Khyber Pass, and Kabul. Emir Sher Ali fled and died in exile, his son Yaqub Khan signed the Treaty of Gandamak, ceding control over Afghan foreign affairs to the British. However, after the British envoy was killed in Kabul, conflict resumed until British forces defeated Afghan forces led by Ayub Khan at the Battle of Kandahar in 1880, ending the war. Abdur Rahman Khan was installed as a British-backed emir, stabilizing the region as a buffer between Russian and British territories.
The Third Anglo-Afghan War occurred in 1919 when Afghan forces under Amanullah Khan sought to reclaim full independence. The brief conflict ended with the Treaty of Rawalpindi, whereby Britain recognized Afghanistan's independence and control over its foreign affairs, ending British influence. This war marked the end of direct British intervention in Afghan sovereignty.