(covers information from several alternate timelines)
An antimatter explosion could be caused by a breach of a matter/antimatter reactor, or antimatter pod. This loss of containment resulted in an interaction with matter that annihilated both substances and converted them into large quantities of energy in a short amount of time. Antimatter explosions were a serious hazard for vessels powered by matter/antimatter reactors.
In 2258, the USS Enterprise was being sucked into a black hole. Montgomery Scott chose to eject the ship's warp cores into the singularity, causing a massive antimatter explosion that safely swept the ship away. (Star Trek)
At some point in history, the Uxali learned of antimatter technology from the Human probe Friendship 1, launched in Earth year 2067. Their early experiments with antimatter particles resulted in a massive antimatter explosion, which rendered their homeworld of Uxal virtually uninhabitable. In 2378, the USS Voyager neutralized the antimatter radiation, restoring Uxal's atmosphere to normal levels. (VOY: "Friendship One")