Actually, prior to the British conquest of India, Afghanistan repeatedly conquered India (or large sections of it), not the other way around.
I believe the last time India conquered Afghanistan was in the 3rd century BC, under Asoka.
Britain and Russia competed for influence in the country because it was a buffer state between their empires, and both were under the delusion that a Russian conquest of India through Afghanistan was feasible.
The US got interested only as a way first of draining Russian resources and willpower during the Cold War, and then to strike back at al Queda and the Taliban.
IOW, there is no consistent reason for powers being interested.
Afghanistan bordered Imperial Iran,which made it vital for both Russia & Britain to fight for influence from the late 1800s to early 1900s.