There is another level behind the atcs of some torrorisit groups who function in the name of Islam . And that one is purely financial…
Although most, if not all, of these groups ( at least their leaders) are well aware that , on the long run, the strategy of attacking civilian targets doesn't work, they also use these attacks to get funding.
In a weird and cynical way, the individuals and organizations who sponsor terrorist groups, have very little interest in supporting those that do not make it into the headlines. Whereas, the ones who do make it into the news, et pretty much all of the attention of the donors.
SO, even if ( a hypothetical) suicide attack on a market which kills 50+ civilians seems to be counter-productive for the overall strategy ( or imagined goals) of the group, hat kind of attack, which ends up in the news all over the world, secures a lot of funding.. Now, some of that funding will go to training, weapons, recruiting etc… but a part of it will always go to the leaders of the group and their families.
Now this is the point… despite of what is portrayed in Hollywood productions, media etc… most of the leaders of any terrorist groups are not the manically-sucidal idiots wo go around screaming how they hate everything but themselves, these guys are generally very cold-blooded, calculated SOB-s, whose quest for power made them use a certain ideology and twist it in their favor. Although these characters, themsleves, are almsot never, or seldom, in the firing lines, they do know how to make others die for whichever cause is usefully at the time. And in a whole lot of cases, their “ideology” is just a way of obtaining personal power and wealth.
SO, a lot of these attacks have nothing to with ideology, and everything to do with who is going to get more donor support…