That was the prevailing consensus in the era of Kipling. There was no doubt in his time about the righteousness of British imperialism and the civilizing, beneficial effect it had wherever it went. That consensus no longer exists and therefore the ability to “win” is no longer possible. The West neither has the will, moral certainty or the disposition to do what is necessary to forcefully transform Islamic culture to make it compatible with modernity. If it is to transform ,it must come from within, or crumble into a violent backwater. Indeed it is far better to leave than to make ongoing fruitless sacrifices.
I am pretty sure that Kipling’s poems have all the answers to any political question.
Kipling understood Afghanistan.
“When you’re wounded and left on Afghanistan’s plains, and the women come out to cut up what remains, jest roll to your rifle and blow out your brains and go to your Gawd like a soldier.”
The place is irredeemable.