The tribbles apparently derive from the Martian "flat cats" of Robert Heinlein's juvenile novel The Rolling Stones. Twins Castor and Pollux transport a cargo of flat cats in cold sleep to miners in the asteroid belt. Both tribbles and flat cats are born pregnant.
Klingons are unique among Star Trek's races in their extreme hatred of these cute little creatures. This might be due to the fact that tribbles emit a loud shrieking noise in their presence (although the tribbles may just be reacting to the sight of their enemy).
Tribbles were originally encountered in the original Star Trek television series, in an episode titled "The Trouble with Tribbles" (written by David Gerrold). Captain Kirk and his crew encounter the Tribbles on a space station while arranging to transport some grain to a colony. The "trouble" with Tribbles is that they reproduce far too quickly - in the words of Dr McCoy, "They are born pregnant" - and threaten to clog up essential ship systems. However, when they consumed the grain on the station, there was a massive die off of tribbles that alerted the Federation that the grain was poisoned. Furthermore, the tribbles also gave away the identity of a disguise Klingon agent who did the poisoning. Thus the tribbles enabled the Federation to score a diplomatic victory against the Klingons. As for Cyrano Jones, the independent trader who introduced the species to the station, he was ordered to remove the tribbles from the station or be imprisoned, a task estimated to take 17.9 years. All Tribbles on-board the Enterprise are beamed onto the Klingon ship.
Tribbles return in the Star Trek: The Animated Series episode "More Tribbles, More Troubles".
In Deep Space Nine episode "Trials and Tribble-ations" the crew of the USS Defiant encounter the Tribbles once more. Since Worf reveals that the creatures were actually hunted down and exterminated by his people, this can only be achieved by time travel. Fortunately, or perhaps unfortunately depending on one's perspective, a number of tribbles were brought back to Deep Space 9 from the past and the species is reestablished. It is not known if this was deliberate or not.