Humans are animals. Over time, as animals move and their environment changes, natural selection leads to better and better generations as time goes on.  The first humans were black, most likely from Northern Africa. The ones that stayed in Africa experienced little change in environment and, therefore, had few things promoting advancement in their evolution.  Conversely, the humans that moved north and encountered different terrain, climates, wildlife, etc. were able to evolve and change into new and better groups of humans. Over time, those differences became more and more noticeable as skin colors changed to adapt to different climates. Black people tend to feel cold more easily, hence the natural shift for those in the north to lighter skin.