Having left K9 Mark III to Sarah Jane (TV: A Girl's Best Friend) following their travels with Adric in his fourth incarnation, (PROSE: Just a Small Problem) the Doctor eventually built K9 Mark IV. The Eighth Doctor mentioned Mark IV when he met Sarah Jane in 1996. He indicated that the effort in constructing Mark III was "nothing" in comparison to Mark IV. (PROSE: Interference - Book Two)
The original K9 model was designed by visual effects designer Tony Harding. One early concept was to have a small actor in a large Doberman-shaped costume; however, Graham Williams vetoed this, saying that the robot should not look like a person in a costume. The eventual design was closely based on Harding's third concept sketch. (DCOM: The Invisible Enemy)
The Fourth Doctor and K9 Mark II spent an indeterminate period of time together. However, the Doctor appeared to be activating K9 Mark II, implying that no significant time had elapsed since leaving Gallifrey. (TV: The Ribos Operation) It is possible that the Doctor spent some time at Nest Cottage before activating him. (AUDIO: The Stuff of Nightmares)
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.
K9's innards were redesigned twice more over the course of the series, firstly in collaboration with a company called Slough Radio Control. It allowed one of its employees, Nigel Brackley, to be seconded to the series semi-permanently to supervise the prop. Brackley, who has since gone on to a career in the movie industry, controlled K9 for many of its studio appearances. Eventually, there came a point where the dog's inherent liabilities were outweighing his assets, and the internal mechanisms were completely rebuilt by designer Charlie Lumm. The wheels were enlarged and given independent drives for power and better manoeuvrability, and the radio controls were switched from AM to FM signals to resist interference. However, by the time the improved model made his debut in State of Decay, the first story recorded for Season 18, the decision had already been made to write the character out of the series in the adventure Warriors' Gate.
K9 Mark 2 had some obvious commonalities with the Mark I that had preceded him. However, as he had almost completely lost his personal memories, he was forced to reacquaint himself with the world around him. Toward this end, he downloaded thousands of human movies onto his memdrive, which peppered his speech with 20th and 21st century English colloquialisms that his "brothers" did not typically employ. (TV: Alien Avatar) Despite his negative opinions of emotions, (TV: Mutant Copper) he asked questions about some, such as fear (TV: Fear Itself) and love (TV: Aeolian). He even showed some, laughing when he saved the day, feeling fear (TV: Fear Itself) and being angry. (TV: Regeneration)
K9 stayed with Leela on Gallifrey for many years. It was only after the disappearance of her Time Lord husband, Andred, that Leela and her K9 met Romana II and her K9. The two K9s did not get on well and competed. (AUDIO: Weapon of Choice) After Leela became Romana's bodyguard and after many important missions on her behalf, Leela's K9 was destroyed by an exploding bomb. Leela was heartbroken, but refused to have a duplicate unit built. (AUDIO: Imperiatrix)