Just to add to the other answers, there are conflicting accounts of what actually happened. The Tribunal Temple has an agenda to further itself by legitimizing the deification of the Tribunal/Almsivi Almalexia, Sotha Sil and Vivec. There is another faction of the Temple, called the Dissident Priests, whose teachings align with that of the Ashlanders.
Each of these two factions have published books (in universe) that reference the events at Red Mountain. The Tribunal uses it's power to suppress the teachings of the Dissident Priests.
Excerpt from Progress of Truth by the Dissident Priests
Ashlander tradition does not place the Tribunal at Red Mountain, and holds that the Dwemer destroyed themselves, rather than that Nerevar destroyed them. Ashlander tradition further holds that Nerevar left Dagoth Ur guarding the profane secrets of Red Mountain while Nerevar went to confer with the Grand Council [i.e., the Tribunal], that Nerevar died at the conference [not of his wounds, according to the Ashlanders, but from treachery], and that subsequently the Tribunal confronted a defiant Dagoth Ur within Red Mountain, then drove Dagoth Ur beneath Red Mountain when he would not yield to their will.
The Tribunal Temple's official account is recorded in Nerevar at Red Mountain.
And so the Chimer and Dwemer went to war. The Dwemer were well-defended by their fortress at Red Mountain, but the bravery and cleverness of Nerevar's queen and generals drew most of Dumac's armies out into the field and kept them there, so that Nerevar and Dagoth-Ur could make their way into the Heart Chamber by secret means. There, Nerevar met Dumac and the Dwarf King and they both fell from grievous wounds. Dagoth-Ur slew Kagrenac and took the tools the Dwemer used to tap the power of the Heart. He went to his dying lord Nerevar and asked him what to do with these tools. And Nerevar summoned Azura again, and she showed them how to use the tools to separate the power of the Heart from the Dwemer people.
And on the fields, the Tribunal and their armies watched as the Dwemer turned into dust all around them as their stolen immortality was taken away.
The Nerevarine also has a conversation with Vivec where he references the Dwemer, and the aforementioned two books.
"In my library, I have made available two conflicting accounts of the
events of Red Mountain, my own true account, and another false account
common among the Ashlanders and preserved in the Apographa. I don't
care whether you believe my account or not. I leave it up to you to
judge which is true."
"The sin of the Dwemer was the creation of a new god from the
substance of a dead god, Lorkhan. That is also the sin for which we
would destroy Dagoth Ur. I hesitate to call it 'sin'. More properly,
call it 'destructive evil'. The sin of the Tribunal, however, is in
the breaking of an oath to Azura to forebear from tapping the Heart
with Kagrenac's tools, and in the folly of seeking to become gods.
Breaking the oath was evil. Becoming gods was folly. If we sinned, we
have paid the price."
"I have no idea what happened to the Dwemer. I have no sense of them
in the timeless divine world outside of mortal time. And, in fact, if
I did believe they existed, I would be in no hurry to make contact
with them. They may, with some justice, hold the Dunmer race
responsible for their fate. My intuition is that they are gone forever
-- and that is perfectly fine with me."
source
Edit:
Doing some reading, I found another interesting reference in The Thirty-Six Lessons of Vivec, Sermon Thirty-Six
Dwemeri high priest Kagrenac then revealed that which he had built in
the image of Vivec. It was a walking star, which burnt the armies of
the Triune and destroyed the heartland of Veloth, creating the Inner
Sea.
Each of the aspects of the ALMSIVI then rose up together, combining as one, and showed the world the sixth path. Ayem took from the star
its fire, Seht took from it its mystery, and Vehk took from it its
feet, which had been constructed before the gift of Molag Bal and
destroyed in the manner of truth: by a great hammering. When the soul
of the Dwemer could walk no more, they were removed from this world.
Resdaynia was no more. It had been redeemed of all the iniquities of
the foolish. The ALMSIVI drew nets from the Beginning Place and
captured the ash of Red Mountain, which they knew was the Blight of
the Dwemer and that would serve only to infect the whole of the middle
world, and ate it. ALTADOON DUNMERI!