Over the course of generations, humans living at the Sun-saturated latitudes in Africa adapted to have a higher melanin production threshold and more eumelanin, giving skin a darker tone.
There's eumelanin, which gives rise to a range of brown skin tones, as well as black, brown, and blond hair, and pheomelanin, which causes the reddish browns of freckles and red hair.