K9 was not originally intended to be a companion, but producer Graham Williams liked the concept so much that the decision was made to retain him as a regular character, in order to appeal to the younger members of the audience. The original name for the character was "FIDO" — apparently from "Phenomenal [sic] Indication Data Observation" unit — but it was eventually named K9.
K9 Mark 2 was the result of the activation of the Mark I's onboard regeneration unit. He had only very limited memories of his past as the Mark I. He had many adventures with Alistair Gryffen, Jorjie Turner, Darius Pike and his new master Starkey. (TV: Regeneration, The Bounty Hunter) Orthrus was an attempt by Drake and the Department to replicate K9, but it was of vastly inferior design. (TV: Jaws of Orthrus)
K9 helped Sarah Jane to defeat Moreton Harwood's murderous Hecate Cult. (TV: A Girl's Best Friend) Circa 1983, K9 Mark III and Sarah Jane lived in semi-detached house where their gate bore a "beware of dog" sign and Sarah Jane permitted him outside unconcealed. Sensing danger, he advised Sarah Jane to either not go out, or to take him with her. She declined, and K9 thus did not accompany her to Gallifrey. (TV: The Five Doctors) K9 accompanied Sarah to an archaeological dig in Egypt. (COMIC: City of Devils) In the early 1990s, K9 assisted Sarah in investigating a supposedly haunted house. (PROSE: Housewarming)
In 1985, a series of gamebooks featuring the Sixth Doctor were published by Severn House under the title Make your own adventure with Doctor Who in Britain and Find Your Fate — Doctor Who in the United States. These books were actually written by scriptwriters for the television series. Martin wrote Search for the Doctor which takes place in the mid-21st century and features K9 Mark IV being reunited with the Sixth Doctor long after Sarah's death.
Although the first incarnation of K9 does not appear again in televised Doctor Who media, he is the star of the 2009 K9 television series, in which he undergoes a sort of "regeneration" process from which a new, more sophisticated and futuristic K9 emerges; in the first series of K9, the character is transported to London c. 2050 by Professor Gryffen (Robert Moloney). Though on regeneration the character loses his memory of his adventures with the Doctor, he assists Gryffen and several teenage companions against a dystopian regime of "The Department". The upgraded K9 has new specifications, sporting a sophisticated head-up display, the ability to fly, and more powerful laser weapons.