During a supposed attack by Vendikar, Anan 7 explains that the war is conducted as a computer simulation, and that the Enterprise has been "destroyed" in the attack. The two planets have a treaty, according to which they must kill the "victims" of every simulated attack. The crew are therefore expected to report to Eminiar's disintegration chambers for execution, and Kirk's party is taken captive.
To nip that in the bud - the original Star Trek had an episode where war on Eminiar VII and Vendikar was simulated but deaths were real.