they way to think about this, is that it's a competition
ISIS-K are not the allies of the Taliban, they are the competition
to ISIS-K, the Taliban are not hardcore enough
so the ultimate objective of ISIS-K is to overthrow the Taliban and replace them with ISIS
hence, once NATO is out of the way, these two forces are going to fight each other
this is how the Taliban are popular again, people are more afraid of ISIS-K, so they are turning to the Taliban for protection
similar situation to Iraq, when the Sunni tribes in the Anbar started fighting against AQI