Terrorism is a strategic and tactical tool, in which the attack on civilians will cause fear and panic, and these fear are maximised by the media.
But terrorism don't come out of no where. There has to be motives as to why they use such (terrorist) attack. The attack is usually motivated by political or social ideology, or mixture of both, as it is usually the case.
Social ideologies can be either "religious" related or "non-religious" related. Non-religious related motive or ideology could be like social class differences or caste.
Terrorism associated with religious group, like al-qadea and ISIS/IS, Hamas, have mixture of both political and religious motives, hence they are often listed as Islamic terrorist groups.the Hamas, for example, seek independence, therefore it is political, but they also try to mix it with islam, to further justify their cause or objective, like they seek Jerusalem as their holy capital.
In Northern Ireland, the IRA was a mix political/social/religious stance against British and pro-British supporters, and against the Protestants.
I think islam and any religion for that matter, don't actually favor such actions, but it would be terribly irresponsible to deny there are no religious fervent or ideology in some of these attacks.