They can figure this out by analyzing the genomes of mitochondrial DNA. Mitochondria produce energy for cells, among other things. They have their own DNA, separate from a cell’s nucleus, and they are thought to have once been distinct organisms that were engulfed by our cellular ancestors.
This research lends some support to Stephen Jay Gould’s theory of punctuated equilibrium, which sees evolution not as a flowing natural progression towards complexity (and human inevitability) but as a series of start and stop accidents that put us here purely by luck.
One more major drought and we’d have gone the way of the Neanderthals.