A favorite book of mine is Evolution: A Scientific American Reader, a collection of articles on astronomy, cell biology, paleontology and anthropology from the print magazine. One of my favorite chapters, "Skin Deep" by Nina Jablonski and George Chaplin, covers the evolution of human skin color. Skin color results from the presence of the pigment melanin, an organic molecule that absorbs UV radiation and neutralizes free-radicals produced by UV radiation. Why do we need worry about UV radiation? UV radiation causes mutations in skin cells leading to skin cancer, and also destroys the essential B vitamin, folate, which is involved in DNA synthesis. The more melanin, the more protection against UV radiation and the darker the skin. Hmm, if that is the case, why do not all humans have dark skin? Better to protect against cancer then, isn't it?
Map of Human Skin Color Distribution
Figure from Barsh GS (2003) What Controls Variation in Human Skin Color? PLoS Biol 1(1): e27 doi:10.1371/journal.pbio.0000027. A traditional skin color map based on the data of Biasutti. Reproduced from http://anthro.palomar.edu/vary/ with permission from Dennis O'Neil.
The answer is that UV light also has another effect: it activates 7-dehydrocholesterol into vitamin D3. Too much melanin will therefore lead to vitamin D3 deficiency. This isn't much of a problem in the tropics where there is plenty of sunlight, but can be a issue at the margins of the world where sunlight is reduced.

There are two competing forces, then, affecting human skin tone: the need to protect against cancer and the need for vitamin D3. The interesting thing is that humans have evolved to carefully regulate the amount of UV light penetrating the skin, and hence carefully balancing the trade-off between vitamin D3 and cancer.

A recent review reports that skin reflectance is lowest (i.e. melanin is highest) at the equator, then gradually increases, about 8% per 10° of latitude in the Northern Hemisphere and about 4% per 10° of latitude in the Southern Hemisphere. This pattern is inversely correlated with levels of UV irradiation, which are greater in the Southern than in the Northern Hemisphere.

There are, of course, exceptions to the rule, but these are informative in their own right. For example, the Inuit natives of the arctic are dark-skinned. This can be explained by the fact that their traditional animal-based diet provides plenty of vitamin D3. Another example is the difference in skin color between the dark skinned Bantu and light skinned Khoisan inhabiting Southern Africa. It poses a puzzle unless one considers that the Khoisan are derived from one of the earliest migrations into Southern Africa, whereas the Bantu migrated from West Africa more recently, perhaps within the past 1000 years.

Jablonski and Chaplin end their essay by writing, "Our current knowledge of the evolution of human skin indicates that variations in skin color, like most of our physical attributes, can be explained by adaptation to the environment through natural selection. We look ahead to the day when the vestiges of old scientific mistakes will be erased and replaced by a better understanding of human origins and diversity. Our variation in skin color should be celebrated as one of the most visible manifestations of our evolution as a species." Read more about skin color here.