Kai Opaka unexpectedly arrives on DS9, with the excuse of wanting the tour Sisko promised her previously. She is clearly preoccupied with something–prophecy, she says. Sisko offers to take her through the wormhole, accompanied by Kira and Bashir, and when they reach the other side, she is apparently waiting for something. A peculiar signal comes through from an unexplored region, and at Opaka's insistence they investigate.
They find a moon surrounded by artificial satellites, but as they approach, one of the satellites comes toward them and fires, seriously damaging the runabout. They crash on the moon, and while Sisko, Bashir, and Kira escape without serious injuries, Opaka is killed.
The moon is inhabited by two warring factions, the Ennis and the Nol-Ennis. The runabout came down near the Ennis, led by Shel-la, who explains the situation. While they are talking, the Ennis are attacked by the Nol-Ennis. They fend off the attack, with substantial loss of life. After the Nol-Ennis retreat, another figure approaches–Opaka. Bashir reports that she is alive, though her cells now contain some biomechanical thing, like nanites. Bashir requires the computer on the runabout to fully analyze the data. The Ennis who were killed also begin waking up, apparently none the worse for the experience.
It is explained that the moon is a sort of penal colony. Both the Ennis and the Nol-Ennis were imprisoned there by their homeworld, since they would not end their conflict. The biomechanical devices do not allow them to die, so they are trapped there, warring, forever, as a warning to the rest of civilization.
Sisko, finding the punishment excessive, offers to transport both groups off the moon. They arrange to meet and discuss an armistice, but neither side trusts the other, nor is willing to end the conflict without winning, so the peace talks degenerate into another bloody battle.
Bashir reports that although the biomechanical devices resurrect people, they are thereafter totally dependent on the devices to survive–and the devices are designed not to operate except on that moon. So the prisoners cannot escape–nor can the Kai.
Eventually Dax and O'Brien find the moon and effect a rescue. Opaka stays behind. It is her destiny, she says, to remain there and help the Ennis and Nol-Ennis work toward peace.