It is a strange thing about religion and terrorism. Here is the scenario as I understand it. Faith is something that troubled people turn to. Most find solace and rejuvenation in it. Some cannot really let go and believe in the unseen. They do not get release from their troubles in faith. Maybe too impatient like a young person is want to be.
Some people have an agenda of hate. Some of them want to proliferate their hate. Hate is a huge motivating factor for those who do hate. Getting a young person motivated by hate offers them a release from their troubles. They can blame it on someone or something. Faith has not worked like a formula and instantly. Anyone can see that the young in a faith are easy targets for creating hate to solve troubles.
Much of the Arab world is Muslim. Much of the Arab world is troubled. Many youth in the Arab world are looking for a release from their troubles. If you are looking for solutions and some hater comes along and shows you one, what are you going to do? Continue praying and hoping for solutions or take action and facilitate solutions? You have already been born into and witnessed violence so it is an acceptable solution.
The religion is just a side attraction. It is not the cause of the problems. It is just a place to find people looking for solutions to their troubles. Give them an easy one and off you go, mix it in with some suggestion of holiness and there you go double.
Did I mention that the haters are also crazy?
Did I mention that the same kind of tactic was used without religion? Sure communism after WWII was on the backs of recruited malcontent youngsters who drank the koolaid and believed in communism. Stalin and Pol Pot did not commit what they did with old people.