Scientists wondered for quite a while why and how sex came into being. After all, there are one or two species that give birth to clones of themselves without having to go through the arduous task of having sex with another member of its species. These creatures don’t need to mix their DNA with that of a member of the opposite sex and thus pass on 100% of their genes. This might sound like a lonely existence but if passing on to the next generation as many of your genes as possible is the goal of life then these creatures are onto something.
Despite the advantage of giving all your genes to your offspring very few life forms actually reproduce this way. Why? Probably because sex is a useful adaptation to the threat from viruses. Shuffling your genome with that of your sexual partner gives your children a much better defense against viruses, which have to hit a moving target rather than a static one. Sex is therefore a good idea from an evolutionary perspective.
Despite the necessity for mixing our genes with those of our spouse, the desire to maximize our own genes in our children remains strong. This urge is almost certainly what leads people to choose mates that are genetically similar to them. Racial, physical and even behavioural similarity are often indications of genetic similarity. In general, if you marry someone from your own race the chances are good that you share more genes with them than you would with someone from a different race. And since your spouse from the same race has some of the same genes as you, your children will inherit these shared genes. The children might then have 60% of your genes, as well as 60% of your spouses genes.
Marriages between couples with many genes in common tend to be more successful than marriages between couples with fewer shared genes. One researcher suggests that sharing 12.5% is ideal. This would be like marrying your first cousin, as did Charles Darwin and as does half the Pakistani population. However such in-breeding over many generations probably isn’t a good idea.
Nationalism and ethnic loyalty might also be expressions of this preference for genetically similar people. When Napoleon invaded Russia 200 years ago it would have been in the Russian peasant soldiers’ interests to join Napoleon since his peace terms, if he could have defeated the Russian army, would almost certainly have included freeing the peasants from the feudal system and a brutal monarchy. Yet the peasants chose to fight against Napoleon, most likely because he was from a different ethnic group. And when in the 20th century Stalin wanted to rally Russians to a cause, he instinctively knew that it was better to appeal to their shared Russian-ness (largely heritable) than to the ideology of Communism (not very heritable).