To reduce it to its most simple:
Suppose boy from Cave #1 shares his genes with those of girl from Cave #2. Each stays living in their own family home, there is no custom for setting up home on your own
In due course, the new boy from Cave #2 shares his genes with a girl from Cave #3
The procedure is repeated, until eventually genes from Caves 1 & 2 have reached Cave 10 …..
Now multiply this up, wrap it in clever mathematics, matrices or something well beyond my payscale, & there you have it