Set in the 23rd century, the series follows the adventures of Captain James T. Kirk (William Shatner) and the crew of the Federation starship Enterprise. In this episode, the crew of the USS Enterprise visits a planet whose people fight a computer-simulated war against a neighboring planet. Although the war is fought via computer simulation, the citizens of each planet have to submit to real executions inside "disintegration booths" to meet the casualty counts of the simulated attacks. The crew of the Enterprise is caught in the middle and are told to submit themselves voluntarily for execution after being "killed" in an "enemy attack".[citation needed]

The Federationstarship USS Enterprise travels to Eminiar VII to bring Ambassador Robert Fox (Gene Lyons) to establish diplomatic relations between the Federation and Eminiar VII. There is little knowledge about Eminiar VII, beyond that they have intrasystem space travel and have had a long-standing war between them and neighboring planet Vendikar; the only contact had been made by the USS Valiant which previously traveled to the system before it mysteriously disappeared and was lost.

Nearing the planet, the Enterprise receive a message from Eminiar VII warning them not to approach under any circumstances. Fox orders Captain James T. Kirk (William Shatner) to enter orbit anyway. Kirk, First Officer Spock (Leonard Nimoy), and additional security personnel beam down to the planet, where they are met by representatives Mea 3 (Barbara Babcock) and Anan 7 (David Opatoshu). Anan 7 reminds them they should not have come, as their city had just been struck by a Vendikar fusion bomb which has killed half a million people. The city shows no such damage, and Kirk inquires how this was possible. They are shown that Eminiar VII and Vendikar, as part of a treaty, participate in simulated war games to avoid destroying either civilization or ecology, but those that are considered "killed" must report to disintegration chambers within 24 hours. The landing party is told that the Enterprise has been calculated to have been struck by a tri-cobalt satellite, and its crew now considered "killed", demanding Kirk order the crew to the disintegration chambers. Kirk refuses, and the landing party is held hostage.

Anan 7, mimicking Kirk's voice, contacts the Enterprise and invites the crew to join in a celebration of newfound diplomatic arrangements. Chief Engineer Scott (James Doohan) doubts the veracity of this order, and after affirming it was not Kirk's orders, believes that both the ship and the landing party are in danger, and raises the ship's shields. Eminiar VII fires on the Enterprise but the attack is easily deflected, and Anan 7 contacts the ship, stating it was just a computer error, and invites Fox to the planet. Fox agrees and demands the shields lowered to allow transport, but both Scott and Chief Medical Officer Leonard McCoy (DeForest Kelley) state their objections and concern for the ship. Fox has the two detained, and he and his aide beam to the planet, where they are quickly taken as captives and ordered to disintegration chambers. Meanwhile, the landing party has escaped its cell and are able to rescue Fox and his aide before they can be disintegrated, and Fox readily agrees to help Kirk stop this.

Kirk and the others approach Anan 7 and the other councilmembers, who still demands that the Enterprise crew submit to disintegration or they will fire on the ship. However, they find that the Enterprise has moved out of range, and Scott is back in charge. Kirk calls to Scott to execute General Order 24, firing on the planet if the landing party is not released in two hours. The agitation among the council allows Kirk and the others to disarm the guards and gain the upper hand. Kirk has Anan 7 take them to the war game computers, and they destroy them, putting an end to the disintegration chambers. Anan 7 laments that they have broken the treaty, and Vendikar will retaliate with real weaponry. Kirk suggests there is a better solution, to call out a ceasefire and engage in negotiations towards peaceful co-existence; Fox quickly offers his services to be a neutral mediator between the two sides.

Some time later, the Enterprise prepares to leave orbit, as Fox, staying behind, reports initial success with peace talks. Spock comments to Kirk on the risk he took that both planets would take the ceasefire once he destroyed their computers, but Kirk explains that his choice was logical: if they hadn't intervened, exactly the same number of people would have died due to the "simulated" war as in the actual military conflict he risked starting - the only difference would have been that if an actual nuclear exchange occurred, it would for the first time damage both sides' infrastructure, hindering their ability to wage war in the future. Weighing the three potential outcomes (simulated war, actual war, or negotiations), Kirk concluded that non-intervention was the worst possible choice.

Zack Handlen of The A.V. Club gave the episode a 'B+' rating. He described the story as "one of Trek's classic allegorically powerful, common sense implausible scenarios." Handlen criticised a premise that had "a few too many holes to sustain its attempts at profundity" but praised the story's ambition.[1]

The DC Comics version of Star Trek had a storyline called The Trial of James T. Kirk, written by Peter David, which contained follow-ups to many TOS episodes. It was revealed therein that the peace talks broke down, and a (genuine) nuclear war took place—completely obliterating Vendikar, and rendering a third of Eminiar a radioactive wasteland. This was further stated in some of the stories in the various "Strange New Worlds" anthologies, as well as the William Shatner novel Preserver, although these stories are not considered canon.[citation needed]

In current Trek novel continuity, the aforementioned General Order 24 has been rendered invalid under Federation law by the 'Eminiar Amendment' (named for one of the planets in this episode), which specifically forbids the destruction of any planet for any reason.[citation needed]