Social and geographical features all play a part.
Egypt, for example, has millennia of dominating (attempting to dominate) the Nubians to the south, who are Ethiopian in appearance; yet there has been a distinctive visible difference between Egyptians and Nubians and Egyptians and Arabs. Similarly, Hitler and his ilk played up the distinction between that German (“Aryan”) master race and the Slavs next door who were of course, designed to be the drudgework salves of the master race (among other bizarre notions). The pygmies of central Africa have remained distinct from surrounding normal-sized people.
Just because ethnic groups are next door to each other, does not mean they will blend. The Ethiopians, Somalis, and Sudanese, I assume, are a different off-shoot of early humans just like the bushmen and pygmies. One item I read (Jared Diamond?) discussing early human migration said there was a much larger genetic diversity across the continent of Africa than between all the groups which migrated out of Africa.
Also keep in mind geography and climate. An ethnic/racial type usually has a lifestyle - the people who have a way of life adapted for the fertile plains of Kenya are less likely to be able to move into and adapt to the relative desert conditions of the northwest Horn of Africa - certainly not successfully enough to displace the people already living there.