Dont't make yourself think that these are the work of some "supreme" power state or some sort of "4th/5th" generation war. Analyze it in a simple economics. The guys who is terrorizing is doing for money. The handler (terror-service-provider) of the terrorist has only one job to sell their services (of terror & killing )to the highest bidder(foreign hand, local, vested interests, whatever u can call). Now the work of these guys are doing lots of damages but the provider remains safe. Once you cut/remove these service provider, you will not see such activities. Until then they will keep doing their business as usual.
Now to remove these provider, one (state) has to be sincerely serious to weed them out 100% from the society. The moment you keep them for future use( strategic dept, assets, or whatever you call) It give them a breathing space. They can always escape the law saying we are the good guys, willing to clandestinely sell their services to highest bidder and secretly call it we did for this or that reason.
I leave it up-to you to analyses the two situations which you mentioned. You may say that the person who provides the money is the important cause, I will say the T-service provider is most dangerous.