Understand this and you will understand everything including endogamy, nepotism and white extinction.
>Gene A
Makes you completely selfish
>Gene B
Makes you altruistic towards your kin but not others
>Gene C
Makes you altruistic towards everyone
The one with Gene A does not multiply much because he is too selfish to care for anyone.
The one with Gene B multiplies because he has healthy amount of selflessness when it comes to his kin.
The one with Genve C does not multiply much because he wastes all his resources on those with Gene B and C.
Gene B is the evolutionary winner. Races, communities and individuals with the other two genes will be overtaken by those with Gene B.