If we're going complete full on speculation zone.
This is my theory. [Don't take this as any sort of canon or what I believe to the extent that I'm not open to other possibilities!]
Long ago, the world exists in a kind of uncivilized state. For whatever reason, some elves are born with unnaturally strong ties to magic. Not a lot of them, but a few. This elevates them to the status of gods among their people. Eventually, all of them come together and agree on a noble purpose- to bring order to the world. To uplift their people and build an empire.
And so they do. They have their spats, and they play the game, but they have their goal. Some of them are perhaps less committed to the goal than others- Fen'Harel, for instance, seems like he might have just been along for the ride. Time passes. The elves in the empire grow more competent in magic. They can't rival the gods, obviously, but a fear begins to grow.
What if we aren't gods?
Then, Ghilan'nain. She clearly has powers that rival the gods, and she wants to join them. Well, its easy to just accept her among you and bring in a sort of mythos around her. But she won't be the last. More and more elves are getting power to rival you. Some elven gods are less concerned with this. Mythal, perhaps. But the others are feeling control slip. They begin to tighten religious control over the populace, demanding things like blood sacrifices to ensure their control is continued. [Maybe take out a few of these extremely powerful mages while we're at it.]
But on the side, they're also looking for new sources of power. Here comes Andruil- she's been hunting in the void, and she's found this lyrium that isn't like anything anyone has seen before. The gods obsess over the red lyrium, and it exacerbates their already paranoid desire to hold onto power. The streets run red.
Fen'Harel and Mythal find themselves on the outskirts watching everyone go mad. Perhaps Fen'Harel convinces Mythal to speak to the others, or they agree to do it together. And she does- she erases Andruil's memory of the red lyrium, but the others still have it in their possession. This time he can't quell them. She's now the enemy, and they kill her for it.
Fen'Harel is now alone. He's never been the hero before, but he realizes he's the only one with power left to stand between the maddened elven gods and the people. He devises a scheme to seal away the elven gods, assuming that this will fix all the problems.
But it doesn't. Arguably, it makes things worse. The elven empire falls. Tevintar comes in, and sweeps away all the magical study that the elves had done. To make matters worse, the elven gods trapped in their prison can sing through the fade and seduce the magisters to follow them into the black city. The blight is reintroduced, but still they aren't free.
The old gods in this scenario are the elven gods. As for what the dragons are- its hard to say. Perhaps Solas put a part of their uncorrupted essence into the dragons for safe keeping. Perhaps it is apart of what is keeping them trapped.
...ooorr its just my crazy thoughts! Which is what it is likely to be. But I figured I'd ramble.