They are playing a rather dangerous game. Remember that the US or Europe could squish them with ease, militarily - if we had to, it wouldn't be hard to nuke the whole region. There are only two reasons this isn't being done: It'd be expensive, and it's mean very large numbers of civilian deaths which would be politically problematic. This situation persists only because they aren't a major threat: The moment they actually become a danger to the continued existance of the US or any major European power they'd be crushed without regard to how much it costs or how many people would die. Remember that as recently as WWII even the allies - the 'good guys' - considered carpet-bombing cities to be perfectly justifiable. During the cold war the US has missiles poised to kill tens of millions at a moment's notice, if they ever needed to.
ISIS can only survive so long as they are powerful enough to dominate the region, but not powerful enough to invoke an unrestrained defensive action from the western powers. Like North Korea: The crazed dictator can brag all he wants about his military supremacy, but he doesn't have it, and that makes him too expensive to invade. if NK ever managed to actually detonate a nuclear bomb even China wouldn't hestitate to march in and take over. I think they'd be glad of the excuse, really.