An uncomfortable fact that policy makers and intelligence analysts do not want to confront is that lack of integration and disillusionment is caused by inbred racism in Western societies to non-conformance of the Caucasian or Judeo-Christian mould. Thanks to regulation, explicit racism is banned, but implicit racism exists and is enabled by both economics as well as technology. Unless you confront racism inherent in some societies or geographies, you will be doing post mortems on events rather than pre-emptive cures. Why does India have much lower cases of home grown terror with 150 million Muslims. It is because they fit well here. Muslim males are not fitting well in Florida or California or on the French Riviera. The golden age of surveillance and the cooperation between technology service providers and government agencies cannot solve the problems of lack of integration due to racism.
Related
https://www.solidarity-us.org/node/1265
https://www.theguardian.com/commentisfree/2015/jun/19/american-mass-shootings-terrorism-racism
http://www.jcpa.org/jl/vp468.htm
https://www.quora.com/Is-terrorism-racism
https://wikiislam.net/wiki/72_Virgins