Kami's History
Background
Kami came into being 300 years before the start of the series, after a nameless Namekian arrived at The Lookout, the home of the guardian of Earth at the time and became his apprentice in hopes the aging guardian would choose him to be his successor when he died. He was loyal to the aging guardian and even successfully outclassed the Makyan Garlic who competed with him, but despite being mostly good he was ultimately denied by the old guardian because of his selfish desire to become guardian due to its benefits, and because of the evil that dwelled within.
He finally became Kami after separating the evil from within himself in order to attain the position, forming an evil twin brother who called himself King Piccolo and shared a lifeline with him (if one died, the other would also). He watched over the Earth from his lookout during King Piccolo and his mutated sons' initial rampage but eventually in a series of long, complicated circumstances they were defeated by the forces of Master Mutaito. He later created the Dragon Balls to give the people of Earth hope and encourage acts of bravery after King Piccolo's reign, though he later regrets it until he met the pure hearted Goku.
King Piccolo Saga
Three hundred years later, at the conclusion of the 22nd World Martial Arts Tournament, Emperor Pilaf frees King Piccolo and soon after Krillin was murdered by Piccolo's newest son, Tambourine. It is later revealed King Piccolo seeks to destroy all existing martial artists to prevent any challengers from learning the Evil Containment Wave that trapped him. King Piccolo also seeks the Dragon Balls to restore his youth before taking over the world again. After Cymbal and Tambourine are mysteriously killed, King Piccolo encounters the young Goku and in the ensuing fight Goku is seemingly killed.
After a battle in which Master Roshi dies, King Piccolo eventually summons Shenron. Chiaotzu attempts to stop King Piccolo's wish by making a wish of his own but is killed by King Piccolo at the last second, who then has his wish for youth granted. Immediately after granting his wish, Shenron is killed by King Piccolo to prevent anyone else from using the dragon against him. King Piccolo invades King Furry's castle and takes him hostage. The next day while preparing to leave for the doomed West City, King Piccolo is confronted again by Goku, who narrowly defeats him by punching him clean through his midsection.
With all his sons dead and himself mortally wounded, King Piccolo spits out one last egg containing his son and reincarnation Piccolo Jr. intending for him to exact revenge on Goku, inadvertently saving Kami's life in the process, before he explodes.
Piccolo Jr. Saga
Shortly after Goku arrives at Kami's mysterious lookout and meets his loyal servant Mr. Popo. Kami agrees to meet with Goku without the long rigorous training required to beat Mr. Popo. Upon seeing Kami, Goku mistakes him for King Piccolo and charges at him, but Kami merely flicks him away. After explaining his origins, Kami, as a reward to Goku for defeating Piccolo, revives Shenron so that all the innocents killed by Piccolo and his sons can be removed from limbo and brought back to life. He then informs Goku he must train under him for three years in order to defeat Piccolo Jr. who would be seeking to challenge him at the 23rd World Martial Arts Tournament.
During this period, Kami restores the moon, which had been destroyed by Master Roshi six years earlier, and permanently removes Goku's tail to stop him from becoming a Great Ape again. He also gave Goku a weighted undershirt, wristbands, and boots.
Three years later, Goku arrives at the tournament and Kami enters as well, but inside the body of Hero, after realizing Piccolo Jr. is stronger than his father was. During the tournament, Kami defeats Yajirobe and Yamcha with extreme ease, managing to completely dominate each battle (and embarrassing Yamcha in their match). However, Yamcha does manage to hit Kami with the Spirit Ball before getting knocked out, which surprises the latter. While he fights the two, he acts clumsily and awkwardly in order to fool the audience and not to raise any suspicion. After defeating the two he then fights Piccolo Jr. and attempts to trap him with the Evil Containment Wave, but at the last second Piccolo Jr. reverses it and Kami finds himself trapped within a Klein Bottle. He exits from Hero's body so he will not be trapped with him. Piccolo swallows the bottle, so that, if Goku tries to get Kami out, Piccolo will die and, by extension, so will Kami. Goku later frees Kami by tricking Piccolo into growing huge so he could go inside his mouth and retrieve Kami, and eventually defeats Piccolo Jr. Goku shows him mercy because Kami would die as well were he to kill him. Still full of guilt, Kami offers Goku his position, but Goku declines, choosing to keep his promise to marry Chi-Chi and flies off on his Nimbus with her.
Saiyan Saga
Five years later, Kami continues to watch over the Earth, and it appears Goku and Piccolo clashing once again is inevitable. One day, a mysterious alien named Raditz lands on earth in search of his brother, Kakarot. Raditz's power and aspirations are even worse than Piccolo's, in that Raditz is far stronger and could also destroy the Earth, rather than make it his kingdom, like Piccolo aspired to. Eventually, thanks to Goku's sacrifice and an intervention from his son Gohan, Piccolo defeats Raditz. After learning that two even more powerful Saiyans are on their way to Earth, Kami brings Goku to King Yemma's office and is able to get him training with King Kai, the king of the North Area of the universe who lives in the Other World on his personal planet at the end of the Snake Way. Kami trains Krillin, Tien Shinhan, Yamcha, Chiaotzu, and Yajirobe for the fight as well. When Goku reaches back to the Check-In Station after his training, Kami brings him back to Earth. Piccolo is eventually killed during struggle with Vegeta and Nappa when he sacrifices himself to save Gohan, and Kami dies immediately after him due to their shared lifeline.
Frieza Saga
Kami remained dead until Piccolo was brought back to life. King Kai contacts Kami asking for him to gather Earth's Dragon Balls. When an enraged Frieza tried to blow up Namek, King Kai initially believed he succeeded, only for Kami contact him and inadvertently reveal that Namek was still there (as Piccolo, who was on Namek at the time, would have been killed if the planet exploded and thus Kami would die again). He is then briefed on King Kai's plan to use the Earth's Dragon Balls to revive everyone who was killed by Frieza and his army, whether directly or indirectly, and then use the Namekian Dragon Ball's remaining wish to move everyone but Frieza from Namek to Earth.
Frieza-Androids Interlude
In the anime, Kami and Mr. Popo were captured by the recently released Garlic Jr. and imprisoned in a container. They remained imprisoned until Piccolo seized the opportunity to shatter their prison (Piccolo faked being under the influence of the Black Water Mist in order to lure Garlic Jr. to get him close enough to the container to free them). Kami and Mr. Popo then went deep into the lookout to use the Sacred Water to counteract the Black Water Mist before it permanently brainwashed the populace to Garlic Jr.'s side, nearly being killed by the previous guardians in the process.
Androids Saga
Kami's role diminished greatly after the heroes return to Earth from Namek from what it had been prior to their journey. After Frieza's death, he was no longer needed for training or wisdom. Because of this, and out of concern for a then unknown threat, he agrees to fuse with the reincarnated and redeemed Piccolo to return to being the original nameless Namekian. The new Piccolo would go on to fight Cell, but never manages to kill him through various complicated events. Because he is a Namekian, he also has the ability to create Dragon Balls, but this is not a skill that most Guardians would have.
After Kami fuses with Piccolo, the post of Kami on Earth is left vacant for a time until Goku goes to New Namek and recruits Dende to serve as the planet's new Kami.
Dragon Ball Super
Kami and Nail made a brief appearance inside Piccolo's mind while he was knocked unconscious while fighting Saonel and Pilina, during the Tournament of Power and they instruct him to keep fighting.
In the manga, Kami made a cameo during Goku's conversation with Master Roshi as the former was reflecting on the teachings of all the masters he has had throughout his lifetime.