Pledging to help Kurdish YPG forces repel a Turkish incursion into northern Syria, Bashar Assad is manipulating the YPG for his own interests.
What Assad really wants here is to twofold.
First, to secure more Syrian territory without having to fight for it, and second, to cut off the Syrian rebels in their Idlib province holdout.
Assad, of course, describes the situation differently. His state propaganda says the deployment of Syrian regime forces to Afrin, near to where the YPG are battling the Turkish army, is about confronting “the Turkish regime’s attack on the area and its people.”
It’s a lie. This isn’t about helping the Kurds hold Syrian territory from Turkey, it’s about giving Assad more control over more territory. It’s a simple question of strategic geography.
With the Kurds now compressed between Assad’s forces in the South and the Turkish army in the North, Assad can move in under the pretense of supporting the Kurds and then take ground on the Kurdish southern flank. What can the Kurds do in response? They lack the combat power to resist both Assad and Turkey, so they’ll have to accept the new status quo.
And by presenting the incursion as a mutual security operation, Assad reduces the likelihood that his forces will come into conflict with the YPG. It’s the perfect daylight robbery.
That said, Assad has another objective here: cutting off the last redoubt of the Sunni rebellion, Idlib province, from its supply corridor to Turkey. As the annotated (black arrows) map below from SyriaLiveMaps shows, if Assad (in red) secures Afrin he can also swing west into Kurdish territory (in yellow) and bottle up the Idlib rebels (in green) from resupply. That will greatly reduce the Sunni rebels’ ability to resist his regime (although it will also serve the interests of Salafi-Jihadist groups like ISIS).

We can also be confident that Turkey and Syria aren’t heading for conflict.
Enter the president of the Russian Federation.
At least in Syria, Putin holds dominion over both President Erdogan of Turkey and Bashar Assad. That’s relevant in that it would be counter to the Russian leader’s interests to see Erdogan and Assad fight. Instead, Putin is focused on maintaining the de facto Russian-Assad-Turkish-Iranian alliance, while pushing the U.S. out of Syria. Erdogan and Assad know this.
In that vein, it is highly unlikely that Erdogan would risk a major conflagration with Syrian forces in fear of upsetting his relationship with Putin. And forget about Assad doing anything Putin doesn’t want, the Syrian dictator is now Putin’s gleeful lapdog.
Put simply, the Kurds and the rebels are the ones who are going to lose out here.