When Sauron is finally defeated near the end of Return of the King, why does his tower collapse? Is the collapse of the tower what triggers the ground collapse that (conveniently) consumes only his army, or is it the collapsing ground that levels the tower?
As with any accident investigation you need to identify the 'actual and proximate' causes of the incident.
The primary cause of the destruction of the Barad-Dur complex (and the ground surrounding Mordor) seems to have been the destruction of the Ring of Power and the loss of the magic that Sauron used to support his tower, despite it being probably being too heavy for the ground surrounding it. The proximate cause of the destruction of the tower was an earthquake that occurred after the destruction of the One Ring and the removal of the foundations on which it sat.
There was a roar and a great confusion of noise. Fires leaped up and licked the roof. The throbbing grew to a great tumult, and the Mountain shook. Sam ran to Frodo and picked him up and carried him. out to the door. And there upon the dark threshold of the Sammath Naur, high above the plains of Mordor, such wonder and terror came on him that he stood still forgetting all else, and gazed as one turned to stone. A brief vision he had of swirling cloud, and in the midst of it towers and battlements, tall as hills, founded upon a mighty mountain-throne above immeasurable pits; great courts and dungeons, eyeless prisons sheer as cliffs, and gaping gates of steel and adamant: and then all passed. Towers fell and mountains slid; walls crumbled and melted, crashing down; vast spires of smoke and spouting steams went billowing up, up, until they toppled like an overwhelming wave, and its wild crest curled and came foaming down upon the land.
What isn't clear is whether the loss of Sauron's magical assistance without the earthquake would have been sufficient to collapse the towers under its own weight, but Elrond seems convinced that the foundations exist solely due to the power of Sauron's magic.
The Dark Tower was broken, but its foundations were not removed; for they were made with the power of the Ring, and while it remains they will endure.'
-The Fellowship of the Ring, The Council of Elrond
In the film's screenplay the collapse of the Dark Tower, its environs and the Black Gate is described as an implosion followed by the collapse of the "Foundations of Mordor". The implication is that the tower itself, the gate and the majority of the roads and paths are built using magic to support their structures. The removal of the magic causes them to collapse under their own weight.
ANGLE ON: the EYE OF SAURON . . .
WIDE ON: Across the GREAT PLAINS - MOUNT DOOM is clearly IMPLODING ...
INTERCUT WITH: EXT. BLACK GATES OF MORDOR - DAY
On the BATTLEFIELD, all eyes turn to MOUNT DOOM ...
ANGLE ON: The CAVE TROLL, with ARAGORN at his mercy, is distracted by the SOUNDS emanating from MORDOR . . . he turns in TERROR and RUNS OFF . . .
EXT. BARAD-DUR - DAY
ANGLE ON: The FELLOWSHIP turn to watch as the MASSIVE DARK TOWER of SAURON shakes itself to pieces! TOWERS FALL and WALLS CRUMBLE; vast spires of SMOKE and spouting STEAM billow up! The FOUNDATIONS explode apart ...
EXT. BLACK GATES OF MORDOR - DAY
The BLACK GATES collapse in a huge cloud of ASH!
THE ORCS are FLEEING in all DIRECTIONS . . . As the very foundations of MORDOR collapse!