Quickly, in light of the Turkish downing of the Russian Su-24, consider:
Turkey has been a lukewarm NATO "ally" against the Islamic State. It has spent more of its efforts attacking and checking the Kurds and its border remains porous. Turkey is still the entry route for foreigners intent on joining IS and the exit route for many refugees and defectors from IS.
Turkey's internal politics have recently seen Erdogan consolidate power.
The US, Iran, Russia, Assad's Syria, and others have just taken great strides toward a unified front against IS.
The question is whether Turkey sees this arrangement as being in its interest.
If it doesn't, would it attempt a plausibly deniable attempt to scuttle it?
Because I think that's what we have just seen.