As part of an officer exchange program, Benzite Ensign Mendon is brought aboard the Federation starship Enterprise. Acting Ensign Wesley Crusher mistakes Mendon for Mordock, another Benzite who took the Starfleet entrance examination with him (in "Coming of Age"). Captain Picard suggests a similar officer exchange with the Klingons, and Commander Riker readily volunteers. Riker is assigned to the Klingon ship IKS Pagh, captained by Kargan. Before Riker departs for the Pagh, Lt. Worf briefs Riker on Klingon customs, and gives him a transponder to signal the Enterprise in the event of an emergency. Riker embraces his role as the Klingon First Officer, and when challenged by Second Officer Klag, subdues him by force, pleasing Captain Kargan and earning respect from the crew.
Before the ships move away, Mendon scans the Klingon vessel and discovers a patch of strange organic material on its hull but does not bring it to Picard's attention. Worf soon discovers a similar patch on the Enterprise hull, identifying it as a lifeform. Mendon then reveals his previous discovery of the same matter on the Klingon ship, and when asked why he withheld the information, explains that on Benzite ships, it is considered improper to bring up a problem before you have a solution. Picard chastises him and orders the Enterprise to intercept the Pagh, as the Klingon ship is even more susceptible to damage from the organism. While en route, Mendon discovers a method to remove the organism.
The Klingon crew also discovers the organism eating away at their hull. Kargan concludes that it must be a new Federation weapon, noting that the Enterprise had heavily scanned the area during their rendezvous, and orders the Pagh to cloak and prepare to attack the Enterprise. Riker is unable to convince Kargan to stand down even after the Enterprise sends a message with instructions for removing the organism. Suspicious of the radio silence, the Enterprise raises its shields. Seemingly accepting his fate, Riker convinces Kargan to close to a distance of 40,000 kilometers before attacking the Enterprise. He activates the transponder he got from Worf and tricks Kargan into taking it. The Enterprise locks onto the transponder signal and waits for the Pagh to get within 40,000 kilometers for transport. Kargan is beamed to the Enterprise 's bridge and draws his phaser but Worf fires first and stuns him. Riker assumes command of the Pagh, decloaks, and demands that the Enterprise surrender, which Picard agrees to, disgracing Kargan further. The Enterprise cleans the organism from the Klingon ship, and Kargan is returned. Riker allows Kargan to hit him and order him off the ship to allow the Klingon to regain some of his dignity before the Pagh departs.
Brian Thompson was cast as the Klingon Lieutenant Klag. He had some difficulties during the audition process as the producers originally sought to have the actor portraying that part wear the same costume created for Christopher Lloyd in Star Trek III: The Search for Spock. His audition was originally cancelled, as he later explained, "I phoned Herb Tobias, who was the head of the agency at the time, and told him what happened. I said, 'Herb, would you mind calling the Star Trek office and figuring out a tactful way of asking them, Who casts this program? The directors and producers or the wardrobe department?'" Thompson praised the work of Jonathan Frakes, saying he is a "true professional and I loved working with him."