It was mostly during the last of the crown wars...
In -10000 the Drow massed for the final battle, and Lolth covered the land in loathsome clouds of black to strike fear in the hearts of mortal Elves. With the aid of Lolth they struck a mighty blow against Miyetar, the nation of the green elves - decimating that race and driving the survivors into a reclusive and barbarian existence deep within the forests of Faerun. The Drow were prepared to win—but then the gods themselves intervened.
Corellon Larethian and his companions struck deep into the heart of Drow territory. Long and hard they fought, seeking the evil in that land. Finally, Corellon Larethian came upon the dread Spider Queen, and he attacked. Magic flared and spat; blood merged in rivulets. Then Corellon struck Lolth a telling blow, driving her deep into the earth. With her defeat, the haze over the battlefield lifted, allowing the bright light of the sun to bathe the land in its healing rays.
Corellon’s magic, as directed through his priests and High Mages, transformed the dark elves, whether the corrupt Ilythiiri or others. The Drow turned their faces away from the sun's purification, preferring instead their fallen goddess. They consciously chose the shadows over light. Some tales (especially those told by Drow on other worlds) tell us that Corellon decreed that such treachery would forever show upon their faces, and is for this reason that the skin of the Drow is dark.