According to drow legends, how did they come to be banished to the Underdark?

Here's what the lore says, drawn directly from the indexed sources:

Drow > Drow > Elves - While most drow shared a hatred of all other races, especially surface races, the object of their deepest hatred was the Seldarine and the surface elves, (especially moon and sun elves) referred to as the "faeries" or the "Darthiir" in Drow language, which also meant "traitors". From the very day a drow child could understand words, they were taught that whatever problems or injustices they faced, the elves of the surface world were ultimately to blame. Hatred for their surface-kin was not simply a taught lesson, but a conditioned response, their name instinctively…

Source: Drow

Dark elf > Dark elf > Description Dark elves had dusky-hued skin and pale hair. Roughly twenty-seven millennia before the raising of the Standing Stone, the Fey creator race opened gates to the Feywild in an effort to undermine the ruling dragon empires. Through these portals, the first elves immigrated to Toril. These primitive elves worshiped the Faerie gods (not the Seldarine, which were unknown at this time). Although most green elves were content to remain in small scattered tribes, one group known as the Ilythiiri, negotiated a truce with dragonkind and began carving out a small…

Source: Dark elf

Corellon > Corellon > History Genesis myths of the people collectively known as elvenkind-elves, eladrin and drow-connected their bloodlines to their one and only creator Corellon Larethian. Of course, each myth had its own version of the tale or a different spin on a another which was a natural result of elves dispersing into different lands and planes, while morphing into different cultures as the years pass. The most popular myths revolve around Corellon's tears of sorrow, beauty, and mirth from which dark elves, high elves and wood elves were created from the respective corresponding…

Source: Corellon

Seldarine > Seldarine > War of the Seldarine In, Araushnee, with the help of her son Vhaeraun, gathered a host of evil deities opposed to the Seldarine, and convinced them to attack Arvandor, in an attempt to overthrow Corellon. Ghaunadaur entered the fray on his own without being asked by anyone. She had planned for the assault to ultimately fail, as her actual goal was for his consort to be killed during the battle and to replace him as Coronal of Arvandor. She tricked Eilistraee into dangerously injuring her own father, but the Weaver's conspiracy was ultimately thwarted by Sehanine…

Source: Seldarine
Want to go deeper or ask something else? Ask the Loremaster