I might be a bit overzealous in saying we can get the results down to 0 but there are many major countries that have not been attacked by ISIS.
The narrative after 9/11, and after both Paris attacks were "this is a war of civilization, of culture. They attack us because we are free". I think a lot of us realise on a conscious level that this narrative simply isn't true, but the narrative still stands.
Foreign intervention make us targets for "retaliation" (I'm trying hard to not apologise for monsters murdering a bunch of civilians pretty indiscriminately). There are many major countries and populations that are easier targets for Daesch that don't seem to get attacked. If this was about maximum carnage so many worse things could be happening right now.
The whole "having a population not super happy about the current government" thing doesn't seem to help (in terms of building a support network). Though even that requires a pound of salt: a journalist on twitter pointed out that in the case of the Paris attacks, there were support networks... but they were mainly for "normal" criminals (drug dealers and the like). We're not talking about a huge set of jihadists, but a bunch of opportunists [0].
I think most people would recognise that the IRA bombings and the Troubles was a result of policy, not culture. Daesch is, I think, pretty similar. It's not like a bunch of people got up and were like "We hate the West!". There's a lot of stuff involved. Not that it justifies their actions, but it's at least good to be lucid when thinking about the why.
[0]: https://twitter.com/joshuahersh/status/712280093343793153