Researchers have cracked the code on how leaders arise from small groups of people over time.