It is known that the Duergar (a.k.a. Grey Dwarves, evil dwarves from the Underdark) were once slaves of the mind flayers, but then managed to break free. However, I can't find much information on how they broke free besides that their gods Laduguer and Deep Duerra were likely somehow involved.
I only have access to 5e material; the most I can find is in Mordenkainen's Tome of Foes, which has a small section of lore on the Duergar, but a lot of it seems like it's from the perspective of the Duergar, their legends and beliefs rather than "what actually happened".
I have found the following:
Their period of enslavement and the revolt against the mind flayers led by their god, Laduguer, purged the influence of the other dwarves gods from their souls and thus made them into a superior race.
— Duergar, p. 77
Two mythic figures who were long ago responsible for the duergar's liberation [from the mind flayers, presumably] have achieved divinity in the eyes of their supplicants.
— Duergar Deities, p. 79
According to legend, Deep Duerra stole the power of psionics from the mind flayers and gifted it to her people. Her command of it was so great that she dominated a mind flayer colony and turned the illithids into her slaves. [It's unclear if this statement has anything to do with the Duergar breaking free of their enslavement, since this could equally just be some act of revenge]
— Deep Duerra, p. 79
Also known as the Grim One, Laduguer was a mighty duergar warrior who liberated his people from the illithds. Laduguer entered into a pact with Asmodeus, pledging the duergar to an alliance against Lolth and the demons of the Abyss in exchange for which Laduguer received a spark of divinity from Abbathor himself [presumably to help with the uprising against the illithids].
— Laduguer, p. 79
So the two Duergar gods, who were just normal duergar at the time (?) helped liberate their people, effectively their equivalent of Gith and Zerthimon (but without the infighting afterwards). Also that Laduguer made deals with devils to gain divinity, which I assume was before/during the revolt, not afterwards.
Besides that, the Forgotten Realms fandom page on Duergar says this:
Eventually, they rose up against their captors and gained their freedom from the mind flayers.[9]
It appears to cite a 3e (or 3.5e?) book, but I don't have access to that book so cannot look for more information within.
How, exactly, did the Duergar break free of the mind flayers? Do we have any more information to go on from previous editions of D&D, or is "Laduguer made deals with devils, then he and Deep Duerra somehow freed their people" the best we've got? Even with regards to the gith gaining their freedom, we know that red dragons of Tiamat were involved, I'm hoping there's a bit more out there about the Duergar too...