I spent over ten years in the Central Intelligence Agency as an undercover operations officer serving overseas after 9/11 where I carried out covert operations against al-Qaeda and other terrorist groups, as well as other countries who are 'hostile to liberty,' as I like to say.
Implementation of reforms within the Police and Intelligence agencies should certainly improve security and reduce terror attacks. But that will not eliminate the problem. Israel, with the most efficient intelligence, security and police has not been able to eliminate the problem, despite the small size of the country.
I think there's a supreme power behind the whole thing, an intelligence. Look at all of the instincts of nature, both animals and plants, the very ingenious ways they survive. If you cut yourself, you don't have to think about it.