If you've paid attention to the news outside of the Coronavirus for the last few weeks, you've probably noticed Sultan Erdogan making a giant nuisance of himself on virtually every front. It's long been said that he's alienated all of his 'allies' and 'partners', but it appears as though he's now painted himself so far into a corner that there's no longer any way out.
The latest troubles all centre around his support for the local headchoppers in Idlib, Syria, but to get a proper view of the situation we need to move back a bit.
Since the beginning of the war in Syria, Turkey has largely meant to carve out a chunk of northern Syria for its own control, either through supporting 'rebels' leading to secession and full annexation or to force the Syrian government to grant some level of autonomy to the locals and to control the region politically. Either way, Turkey has long supported those 'rebels' in their fight against the government. Throughout the war, Syria (supported by Russia, Iran and Hezbullah among others) has largely run an 'army, green bus or cemetary' policy - rebel fighters, so long as they weren't wanted for serious war crimes, had the option of joining the army and being granted amnesty, taking a green bus to Idlib province, or fighting it out. The goal here has been to give rebels the option to leave quietly, minimising civilian casualties in rebel-held areas, but has now cemented Idlib as a massive, festering rebel stronghold.
The Idlib region is important for Syria for a number of reasons, most specifically because the rebels are able to use it to block the crucial M4 highway, so the Syrian side has been keen to retake it - military options weren't ideal though because of the strength of the rebels in the region and the fact that there are huge numbers of civilians still there.
It's here that Turkey began to take a more direct role in the conflict rather than just supplying the rebels with weapons and PR (via the White Helmets and others). Several agreements were made between Syria and Russia on one side, and Turkey and the rebels on the other - the most important being known as the Sochi and Astana agreements laid out 'deconfliction zones' and agreements to reduce tensions with the goal of an eventual political solution. Turkey, acting on behalf of the rebels, entered Syria to create 'observation posts' in the newly de-militarised zone between Idlib proper and the SAA's contact line. The agreement here was that heavy weapons (artillery and MLRS) would be moved away from the DMZ, and that Turkey would disarm the 'bad terrorists' (HTS and other Al-Nusra offshoots, ISIS remnants) in order to support the political power of the 'good rebels' (the Turkish-invented groups like the FSA and NySA, who are largely part-time HTS fighters anyway). In return, the SAA would stay out of Idlib province and hold back on any sort of military operations in the area.
Turkey failed to meet any of the conditions of the agreements. The 'observation posts' were used to resupply rebel fighters rather than keep them under control, no effort was made to separate the 'bad terrorists' from the rest, and the rebel side constantly broke the ceasefire with mortar attacks on nearby towns and SAA positions. For several months Russia petitioned Turkey to adhere to the conditions of the ceasefire until the SAA considered it untenable and began Operation Idlib Dawn, and began retaking the towns around Idlib proper. This upset Erdogan greatly, and to counter the (at this point, very effective) offensive he began stepping up Turkish support for the rebels in a number of ways - previously support for the rebels had been kept below the threshold of 'plausible deniability', where they'd be supplied with rations, weapons, intelligence, logistical support and the like, but they were now also being provided with direct military support. There are several documented instances of HTS offensives (including suicide attacks and VBIEDs) being backed by Turkish artillery support and TAF soldiers fighting on the front line with them, but things came to a head when RAF jets obliterated an in-progress HTS attack against the SAA, only to find that 36 TAF soldiers were among the dead.
Things Fall Apart
This is the point where Erdogan blew his top, and very amusingly claimed that his previous and ongoing support for the rebels was justified by this - that he was justified to support terrorists because the RAF killed a bunch of his soldiers that they did not know were embedded in a terrorist battle group. Erdogan attempted to use NATO Article 4 to draw the US and the rest of NATO into a war against Russia, but nobody was stupid or crazy enough to go to war with a nuclear power over his support for ~30,000 literal terrorists. As a result he changed his tone, and placed the blame for the attack on the SAA, claiming that he was justified in striking them as retribution. It's also amusing to note that at this time, all social media in Turkey was shut down, likely in order to prevent the spread of information related to casualties but it proved ultimately fruitless.
Turkey began to strike SAA targets with drones, claiming roughly 2000 kills, though accurate numbers are probably closer to 200. To their extreme discredit, the RAF did not interfere in this first wave and simply allowed it to happen - it makes sense that they meant to stay neutral in the brewing conflict, but they could've prevented significant casualties to their ostensible ally and their failure to do so damages their credibility with the soldiers on the ground (which, due to complex political strategy, is already shaky at times). That said, in the ensuing Turkish drone strikes, the SAA were able to shoot down over 30 (roughly half of Turkey's combat-ready drone fleet) and covertly-activated Russian ECMs have made it far too dangerous for strikes in the region to continue. In real military terms, Turkey has lost far more (both in economic and power-projection terms) in the exchance than the SAA or Hezbullah. In the ensuing chaos, the SAA has been able to retake Saraqeb and control the strategic M4 highway, even after several failed attempts (including one botched chemical attack) of HTS to drive them out.
Turkey has been forced to go to Russia to mediate another 'political solution', though all sources indicate that the Russian government has had about enough of Erdogan's dicketry and the best he can hope for is a 'face-saving' way for him to get his troops out of Syria.
Erdogan's finished his meeting with Putin, and has been forced into some very serious concessions that 'rebel' social media is absolutely seething about (and historically speaking, this means they'll do everything in their power to undermine it). The M4 highway is to be reopened with a 6km DMZ on either side, this time it will be jointly patrolled by Turkish and Russian MPs, and attacks or incursions into the zone will be brutally suppressed - the RAF will respond directly to any attacks on the area. This effectively puts the Russian MPs in the role of babysitters, making sure that Turkey and the rebels behave and observe the agreement to the letter, otherwise the Syrian side will have full justification to respond.
Again though, the rebels appear to have no intention of abiding by the conditions of that agreement, and the only thing meant to keep the TAF in check is Russian supervision - this is more likely to produce justification for a war to drive Turkey out rather than any long-term de-escalation.
There's been a facet of Erdogan's 'strategy' that we haven't touched on yet, though it ties in to virtually everything described above - Erdogan's use of 'refugees' as a weapon against Europe.