Human nature exhibits some unusual behavioral traits - unusual but not unprecedented in the animal kingdom. In particular, we are capable of a very high degree of altruism and have a strong tendency to group ourselves into tribes. Like ants, bees, termites, certain shrimps and naked mole rats and a handful of others, we are a eusocial species. All such species, asserts Edward O. Wilson, writing in The Social Conquest of Earth, start with the adoption of a defensible nest.
One solid principle drawn from this analysis of the hymenopterans, and other insects as well, is that all of the species that have attained eusociality, as I have stressed, live in fortified nest sites. A second principle, less well established but probably nonetheless universal, is that the protection is against enemies, namely predators, parasites, and competitors. A final principle is that, all other things being equal, even a little society does better than a solitary individual belonging to closely related species both in longevity and in extracting resources from the area around a fixed nest of any kind.
Wilson, Edward O.. The Social Conquest of Earth (pp. 148-149). Liveright. Kindle Edition.
So too, it was with us, he argues. Once we gathered around a campfire, we had the foundation of a defensible nest.
Human nature, in both its good and evil aspects, was profoundly shaped by the last two million years of evolution which transformed us into our modern eusocial species. Primitive life was transformed from the "war of all against all" into the war of our group versus the other groups. We have some pre-programming that shapes us to behave altruistically toward members of our own group and treat other groups with suspicion and hostility. The groups in which this behavior evolved consisted of 30-100 members. Building larger groups, like chiefdoms, nations, and civilizations requires expansion of the in-group. The natural tendencies of such larger aggregations to fragment are amply demonstrated, and the same thing happens even at the level of the primitive group.
Terrorists, even those crazy as a bedbug, are usually seeking to divide a nation into mutually hostile tribes. Plenty of wack-jobs, like the Republican ex-Congressman who exulted over the prospect of race war after Dallas, and threatened Obama, are happy to join in. The same sorts of morons, plus the egregiously evil minions of Roger Ailes at Fox News, like to beat up on Obama for refusing to say "Muslim Extremists." They are either too dumb (or too evil) to recognize the fact that Obama is trying to prevent tribal warfare, not promote it.
Unfortunately, human nature means that plenty of humans really do relish the prospect of tribal warfare, especially if they think that they have the upper hand or that God is on their side.