Grievance - ideology - mobilisation -- those are the three generally recognised stages.
The role of ideological leaders, political or religious are key in the 2nd and third stages. Legally they may do no wrong, but in reality they may provide the human resources necessary for terrorist acts.
Their social networks are no doubt a key target for today's intelligence efforts.
But if we want to intervene at an earlier stage we have to address grievances.