Fast-breeding tribbles overran Deep Space Station K-7 and the Enterprise, and by dying they exposed a Klingon plot to poison grain meant for Sherman's Planet.
Deep Space Station K-7 lay near Sherman's Planet, a world claimed by both the Federation and the Klingon Empire. Under the Organian Peace Treaty the planet would go to the side that could best develop it, so the Federation was shipping a high-yield grain, quadrotriticale, to the station. Undersecretary Nilz Baris asked Kirk to guard it, while a Klingon ship under Captain Koloth sent its crew to the station on shore leave.
The trader Cyrano Jones gave Uhura a tribble, a soft purring creature that bred at enormous speed. The tribbles spread throughout the Enterprise and the station, and a brawl between Starfleet crew and Klingons in the bar led Kirk to confine his men. When Kirk opened the station's storage compartments he was buried under tribbles that had gorged on the grain, many of them dead.
McCoy found that the grain had been poisoned. Since tribbles reacted with hostility to Klingons, they revealed that Baris's assistant, Arne Darvin, was a Klingon agent. Scott beamed the tribbles over to Koloth's ship. Starfleet officers from the 24th century later travelled back to these events, as shown in Trials and Tribble-ations.