The first humans lived in Africa and had dark skin, which protected their skin cells from the harmful effects of UV radiation. Human migration out of Africa began around 70,000 years ago. A mutation in the kit ligand gene in an ancient human population impacted melanocyte production and subsequently led to lighter skin in populations that migrated out of the Northwest Arabian Peninsula and into other regions. This mutation is absent in people with sub-Saharan African ancestry. Another group of humans migrated directly from Africa and retained their dark-skinned characteristics.
As the European population continued its expansion, they had further genetic mutations in the genes of two transporter proteins called slc24a5 and slc45a2, which aided in the production of EU melanin. The function of the proteins from these genes was compromised, resulting in less EU melanin production and lighter skin. Meanwhile, one of the main populations that migrated northeast out of the Arabian Peninsula experienced a mutation in a gene called mfsd12, which shifted skin pigment production away from EU melanin towards the lighter pigment feo melanin.
Overall, human migration was not a simple one-way flow of traffic, and there were likely multiple migration events and movements back and forth to and from different regions. The diversity of skin colors in modern humans can be traced back to these ancient migration and genetic mutation events.