"Those who cannot remember the past are doomed to repeat it," George Santayana. I strongy recommend the two books mentioned by skridlov and TakwillaFlyboy:-
The Great Game by Peter Hopkirk
The Return of the King by William Dalrymple
However hard we fought, I don't think the West ever had a chance to change Afghanistan. It will be very interesting to see if the Chinese with a different approach will succeed.