There is no chance that the leadership of Turkey feels any bond or affection toward ISIS or any other affiliated groups. Although Recep Tayyip Erdogan certainly shows Islamist trends, he is nowhere near Abu Bakar al-Baghdadi ideologically. And although there are many Turks which have decided to join ISIS, the overwhelming majority of Turks are against the group.
So the possibility of “collusion” because of some deeply-held ideology is impossible. The presence of ISIS in Syria, however, presents some strategic opportunities for Erdogan and those in his Sunni coalition. ISIS is an opponent to the Kurds and Assad, both of whom are enemies of Erdogan. One threatens to support independent Kurdish movements within Turkey, while the other is a target for regime change.
To be clear, “support” in this sense doesn’t mean that the Turks are directly sending arms to ISIS. A lot of the arms they have sent to Syria do end up in ISIS hands, but they also end up in the hands of the Kurds. Furthermore, Turkey’s oil trade with ISIS is practically non-existent, considering the nature of the trade. The group sells rights to independent contractors to extract oil and where the oil goes is no longer a concern as long as ISIS gets the money. A lot of the oil is bought up by Kurds, Assad loyalists, and rebels as well, not to mention Turks.
But Turkey does turn a blind eye to what ISIS is doing. For a long time, the Turks refused to let the West bomb ISIS from its territory until it was forced to when terrorist attacks starting occurring in its territory. The Turks also let arms and people smuggle into ISIS from its territory, letting known Islamists cross its border with Syria. Turkey also allegedly turned a blind eye to the terrorist attack in Ankara in October, perhaps in a bid to create fear and a security crackdown to give Erdogan the election.
All of this is done with the intention that ISIS will bleed Assad and the Kurds. The hope is that eventually, all three groups will eventually destroy each other so thoroughly, that Ankara could send its own men, whether they be actual Turkish soldiers or rebels which it equipped and trained. Of course, the Russians threw a wrench into Turkey’s plans and now there is little Ankara can do. Furthermore, Turkey’s policy towards ISIS has become such a political liability that crackdowns on the group are increasing and troops were sent into Iraq to train forces to retake Mosul.
Another, perhaps more important, reason to turn a blind eye to ISIS is to strengthen it to such an extent that America and the West will have to intervene. In pushing for this, Erdogan has been successful. However, he is not getting quite the success he wished to see. His likely intention was not only to see the US intervene against ISIS, but also to push for regime change and to weaken the Kurds. The US refused to send ground troops and instead pushed Ankara to send its own, which would have proven to be immensely unpopular in Turkey where people do not want to see the country dragged into the Syrian Civil War.
So Erdogan dragged his feet on full intervention until it was too late. It seems that Russia saw this and as the so-called “Allen-Erdogan Safe Zone” in northern Syria was being planned, Russia began send more equipment and arms to the regime and ultimately directly intervened. Russia essentially checked Erdogan’s ambitions and a diplomatic conflict is currently ensuing between the two.
Putin spoiled Erdogan’s strategy and the latter has very little room to maneuver now. Talks of a safe zone in northern Syria led by Turkey are still going around, but the stakes are much higher now, and Erdogan saw how deeply reactionist Baghdad was to his decision to send a substantial force into the country. If such a zone is established, air support will have to come from the West as Turkish jets would certainly get shot down by the Russians. If such a maneuver is pulled, however, it will have to have approval from the Russian beforehand.