Duergar is a blanket term for several dwarven subraces, as the word Duergar simply means “dark ones” in Dwarven. There is a lot of fluidity between subraces.
True Duergar are simply twisted by the same Underdark forces that changed the Drow. They are the most likely to be untainted. As with the Dark Elves, the disposition of any particular Duergar is heavily dependent on his society and personal beliefs, making encounters with them tricky for adventurers.
Derro, meaning “Those Exposed to the Light” are almost entirely hostile and unstable, their minds shattered by “The Great Improvement.” What exactly changed them is unknown, but whatever it was, it lurked deep inside of the earth and has changed the Derro forever.
Azer are descended from a specific class of smiths in Dwarven society that took on aspects of flame in order to create more powerful magical items. They sought to tie their very forms into the blacksmithing process, and yet their efforts estranged themselves from their own people, and the Azer became a distinct group in order to continue their pursuits.