They all took to the life rafts and assumed the ship would blow up itself but it successfully jetisoned the antimatter pods.
I recall that when everything else failed, Picard set a destructive course towards a planet, but the ship merely skipped off the atmosphere and floated safely to outer space. Probably both things happened in the story...
Leading to the plot point of the Stargazer being flat out of antimatter and the ability to make her own in the TNG episode. And I think their detonation leading everyone to believe the ship had actually been lost.
We don't need to postulate the ability to make antimatter if we don't claim the pods blew. These things are supposed to be idiot-proof and all; safely keeping the antimatter in store for half a century might not be much of a problem.
The same goes for the longer-idled Hathaway
in "Peak Performance", although that ship could have been refilled by the E-D. Of course, the Stargazer
could have been refilled by the Ferengi, at no extra cost (The shame! The shame!).