I think it's part of the proxy war in Syria. Russia is lining up with Iran and Hezbollah, to support Assad, and the Sunni tribes are violently opposed to this, along with the 'Sunni axis', which includes Turkey. So some of the tribes have been supporting IS, and allegedly, Turkey also.
I haven't a clue as to how this can be resolved, and I wonder if the Western powers have some kind of plan. If they don't factor in the Sunni tribes, forget it, they will stick with IS.
There is some history behind this in Iraq, where the tribes fought against Al Qaeda, but then felt betrayed by the Iraqui govt, who ignored them, hence the drift back to IS, as part of the so-called Sunni revivalism.