Because of melanin. Evveryone's ancestors were black at first, but then, when they moved out of Africa to colder places, when they gave birth to children*, they grew lighter and lighter because there was less sun where they were living, and so the body stopped producing as much melanin, because it would be useless. Basically white people and asians evolved but black people didn't need to.
*When I say this, I mean generations later.