Pakistan views all geopolitics through the prism of its hostility toward India. Afghanistan lies to the rear of Pakistan, so the Pakistan military wanted a friendly government in Kabul that was resistant to Indian influence. This is why, after Russia left Afghanistan in 1988, Pakistan nurtured and supplied the Afghan Taliban movement.