Under Construction
This is my own theory to answer questions, for which I've seen no good explanation. I've done minimal research on the topic and haven't found any academic studies on the subject which support it.

Why is there so much ethnic strife in third world countries?
Why is so much discrimination in the developed countries?

I used to call this the mean gene, but my son pointed that this term is associated with sociopaths not people who distrust others because of a tribal survival instinct.

My personal opinion is that over our existence as a species the world had gone thru many cycles of feast and famine caused by drought, over farming, over-population, .... (Many attribute the decline of the Mayan culture to famine). Societies who could limit their size so as not to outgrow their resources would have survived. One way to limit your size is for a smaller group to distinguish themselves as better than the rest of the population and drive them out, seizing scare resources for themselves.
At different times in the growth of the U.S. Blacks, Jews, Catholics, Irish and others have been discriminated against.
My son, who's a neuroscientist, thinks this dosen't hold water, and he's probably right.

Why is there less strife in the developed world?

Maybe not. In the post Trump election discussion a reporter who had spent time in Somalia pointed out the people there all speak the same language and are part of the same tribe, but there is still a lot of hate there.

There are several reasons.
In Europe people have migrated to countries with people like themselves.
With more economic prosperity there is less discontent.

In the US, many of us came from ancestors who decided to emigrate. These people have an adventure gene which allows them to leave the comfort of a familiar environment and go to a strange place. People with this adventure gene must suppress their tribal gene in order to be accepted in a foreign environment.
However when one group e.g. caucasians (English, German, Italian, Irish, ...) become assimilated and gain power the tribal gene tends to get expressed.

Links:

last updated 2 Nov 2015