The Emerald Nightmare has been one of those persistent concepts that WoW has touched on, but we've never really done much within it. There is one quest - part of a chain in Icecrown - where one travels to the Moonglade and steps into the Nightmare, and if I recall correctly, the nightmare is also present within the prison on Mount Hyjal where we evacuate Fandral Staghelm and unwittingly put him in the hands of one of Ragnaros' pawns.
For a long time we suspected the Old Gods might have something to do with the Nightmare, but for some reason the first Satyr Xavius is also associated with it.
World of Warcraft Chronicle cleared up a lot of things, but we are left with a seeming contradiction here.
We now know the root cause of the Emerald Nightmare, and while I didn't intend it, that was kind of a pun. The Night Elves tried to create multiple world trees - there's one in Val'sharah, one in Grizzly Hills, the enormous Teldrassil, and one, obviously, on Mount Hyjal. The latter of these, Nordrassil, served its function, nourished by the waters of the Well of Eternity (in fact it was planted there to sort of regulate the mini-well Illidan created after the Sundering.
Vordrassil, created in Grizzly Hills in Northrend, was planted too close to the prison of Yogg-Saron, and while the Old God was mostly contained within its prison of Ulduar, some of its tendrils were able to reach the roots of Vordrassil and allow corruption to seep into the Emerald Dream, creating the Nightmare as we now know it.
It's not clear if the other Old Gods were able to contribute to the Nightmare. For a long time there seem to have been hints that it was N'Zoth who was behind the dream - or that N'Zoth may actually live at the center of the Nightmare.
These theories seem to be falling apart, though. N'Zoth is probably somewhere beneath the ocean, probably near Vashj'ir (the enormous tentacles corrupting L'ghorek there might actually be N'Zoth's.) Obviously, the Old Gods are so enormous that they span the better part of continents. My theory is that all the twitching bug-structures in Tanaris, Un'goro, Feralas, and of course Silithus are actually parts of C'thun, and clearly anywhere you can find Saronite deposits, Yogg-Saron's anatomy must be somewhere nearby.
Still, Chronicle explicitly stated that the Nightmare is due to the corruption of the Old Gods seeping into the Dream, which is not terribly surprising. Given what we're seeing of the models and creatures within the Emerald Nightmare raid, they're definitely reinforcing this idea. Just in case Ilgynoth didn't look enough like something out of an HP Lovecraft story, there are also faceless ones (also known, according to Chronicle, as N'raqi,) that serve as adds during the fight.
But here's the thing:
Chronicle also tells us that the entire reason Sargeras started the Burning Legion was to destroy the Old Gods and any world that they might corrupt - in other words, all of them. Sargeras is unquestionably evil - for one thing, you'd imagine that the demons would be less sadistic if Sargeras really just wanted to euthanize the universe - but he justifies his actions because it would mean the defeat of the Old Gods and their creators, the Void Lords (beings we haven't even come close to encountering.)
So why is Xavius, a demon, affiliated with the Nightmare? Why does the Legion seem allied with the Nightmare? Or are they?
Here's the thing: The Legion doesn't exactly act in a manner that is true to its mission statement.
According to the official story, the Legion should simply use fel magic - that's fel, not shadow - to burn away every world in the universe. Just send a constant bombardment of Infernals and Abyssals and burn the planet to a crisp, then move on to the next world.
But that's the official story for Sargeras. And while he's evil and suffused with fel magic, Sargeras is not exactly a demon. He's a titan. The demons want things to burn, sure, but that's not the only thing they want.
The whole reason Sargeras turned on the universe is that he found a planet with a proto-Titan World Soul that was in the process of being corrupted by its own local set of Old Gods. What drew him there? Dreadlords, aka Nathrezim.
Nathrezim who were working for the Old Gods.
Demons don't inherently have anything against the Old Gods. They're only fighting them (and not really in a direct way) because Sargeras commanded them to - do it or die permanently. But demons are beings of chaos, and they don't really care what happens as long as they get to bring about mayhem and destruction.
The Legion has plenty of void and shadow magic going on within it - something that Sargeras would be unlikely to condone. Historically we've seen plenty of voidwalkers within their ranks (and we've been able to summon them as Warlocks since vanilla) despite the fact that they're technically not even demons (except for gameplay purposes.) How come?
Well, perhaps the Nathrezim never stopped serving the Old Gods.
Sargeras secured the allegiance of the original members of the Burning Legion through threat and coercion. He essentially said "the whole universe has got to go, but if you serve me you'll be last to die." That's plenty to motivate you to play along, but it also heavily incentivizes you to fail. The Nathrezim would probably prefer to keep on living, but with a freaking Titan breathing down their necks, they're going to appear to cooperate.
But the Old Gods and the Void Lords offer them something else - a universe of unending darkness. That's something that might be more appealing to pretty dark creatures. And indeed, seeing a Dark Titan Azeroth arise and tear Sargeras apart would probably be really, really cathartic.
The Legion has been historically presented as a uniform entity that is unending and wholly dedicated to its task. But perhaps, as we fight against them in this upcoming expansion, we'll find that there are wheels within wheels here, and the defeat or destruction of Sargeras would mean the beginning of entirely new conflict.