But that's mostly true because those countries are rich and fly half the world away to attack poorer countries and usually by bombing them from far away. Eg syrians can't realistically gather enough money and weapons and planes and bombs to bomb paris. Or iraqis london. Etc. On the other hand, they can gather a few fanatics, give them guns and have them shoot a bunch of people, or bomb something, or worse. But then we get the "why did those people get radicalized? was it GTA?" articles.
TBH, considering the number of dead in palestine and the number of people in europe/us who literally lost everyone who ever mattered to them, the number of "terrorist" attacks seems relatively low.
Why is that relavent? The point is that some countries have more immediate security fears then others. It doesn't matter what structural factors lead to that. Countries with realistic security fears are going to invest differently than those that don't. Countries like people do whatever they think is in their best interest.
If your point is the world is unfair, then yes obviously that is true, nobody disputes that.