Why are the Kurds allied or cooperating with the Syrian government?
They started off with an informal truce, leaving each others' territories alone whilst they fought off common enemies
I thought the Kurds were among the rebels?
They were a separate faction from the rebels, and the rebels themselves were split up into many factions. From the start the Kurdish rebels were against some of the Turkish-backed rebel groups and were also forbidden to advance on certain towns by both Turkey and USA (who to be fair, were trying to balance elephants), so in 2015 the Syrian gov and Moscow offered them an alliance to help them unify the Kurdish enclaves currently kept apart by Turkish backed forces and a great big swathe of ISIS. With most of the urban centres being controlled by the Syrian gov's various groups of desperate religious minorities and the countryside having been scoured of all religious minorities, the northern countryside is pretty much split between Jihadist groups and Kurds. Technically the Rojava has never stopped being a part of Syria and they've never yet made moves to secure independence from Syria just yet, but they are certainly at the very least securing their autonomous Syrian zone. The unification of Kurdish enclaves into the Rojava also especially alarmed Turkey as did their Western push to the Kurdish enclave of Afrin, for the very clear reason that a large autonomous continuous Kurdish region on the border of southeastern Turkey (where the Turkish Kurds are all at) could have devastating implications, either by supplying PKK with materiel or actively trying to help the PKK join the Rovaja or even try to create Greater Kurdistan as an independent nation state. If they win then the Syrian government will be indebted to them, the enclaves will be united and continuous, capable of supporting one another - and they will be indispensable. From that position of victory they would be able to more formally or informally unite/support the Iraqi and Turkish Kurds. If they are less successful then they win the support of the strongest faction in Syria. Win win
*EDIT
Look at Al-Hasaka, it basically sums up Kurdish-Syrian relations in a nutshell. It's a city in northeastern Syria that was controlled by the Government and has a large Kurdish population, the Kurds and Syrians fought against ISIS alongside one another then when the Syrian troops withdrew West the Kurds took over much of the city's defence and administration, taking control of 3/4 of the city alongside allied Christian Armenian militias and more moderate Muslim militias (some of their members blew up a church but they as a whole keep things less genocidy). The rest of the city is still controlled by the Syrian gov and they get along just fine, I think the Syrian gov has pretty much accepted at this point that Kurdish autonomy is reality if they even hope to retake their Iraqi border. Also quite symbolically when ISIS attacked the Syrian gov's holdouts the Kurds intervened within a week and expelled ISIS from the city and northern countryside giving time for the Syrian army to bring in reinforcements and retake more land too.
Though of course, Al Nusra would be a common enemy.
I think the whole threat of World War III is overblown. Sure there could be some under-the-belt slaps and lowblows between Russia and others, but the real powderkeg is the MidEast. So, I think it'll be localized to the Mideast region.
What happens in the Middle East does not localize in the Middle East very well