Shenron is the legendary dragon who is summoned by the dragon balls. He was formed by Kami, and later reformed by dende from a strange energy that is spread throughout time and space. It is later revealed in the Zaecor Saga that this energy is infact the remainder of Goku, after he turned in Kaioken Super Saiyan 5 x1 million to defeat Zaecor and dissolved into pure energy.
When Goku dissolved into pure energy after turning into Kaioken Super Saiyan 5 x 1 million for just a few minutes to be able to defeat the legendary Namek Zaecor I, this energy was spread throughout time and space. It was first noticed by none other than Zaecor I millions of years ago on Namek, and he used it to create the Original Dragonball, Which brought all the Namekian tribes together under one banner, the banner of the Dragonball.(This ball also gave Zaecor eternal life, and he ruled as the High Emporer of all Nameks for many many years) When the legendary Dendan rebelled against Zaecor's rule, Zaecor therefore had no choice other than to split the dragonball, releasing Goku's power, which he hid in the mind of his most recently born child, Piccolo. Zaecor fled namek, as the sheer power of the dragonball unleashed ripped it apart, killing almost all the Nameks, save the son of Dendan, Tarun.(Guru) Many years later Tarun stopped the destruction of Namek by creating not one, but 7 dragonballs out of another strange energy, this time the energy left by the death of Bardock. Then he created the first Great Dragon out of the dragonballs energy, reforming Bardock in the form of Porunga. Meanwhile, Piccolo landed on earth, his memory of Namek wiped due to Goku's energy. He released this energy when he created the dragonballs shortly after splitting into Kami and piccolo, using it to create the great dragon he named Shenron, although, it was really just Goku, reformed from his form of pure energy, although much of his energy still resided inside Picolo and Kami, which Zaecor would want to reclaim.
Shenron is first seen returning from his training with Goku after he realises that Zaecor had found him, and was coming to destroy him, and he and himself(Goku) could not beat him alone.
Shenron is seen again when Goku is fighting one of the Sons of Zaecor, Hokir. Hokir is able to retrieve all the dragonballs, and summons Shenron, about to wish for Shenron to revert to his pure energy state, when he is interrupted by Grand Kai, who knew what the combined power of Goku and Zaecor's millions of years of training could do to the universe. Just as the fight began, Goku joined the fight, in which he went to Super Saiyan 5 for the first time.
Shenron is later summoned by Zaecor himself, where he makes the wish to revert the dragonballs back into a single dragonball, which Zaecor absorbs into his being, although much of goku's power still resides in Piccolo, who is dead, and so Zaecor travels into the Other World.
Shenron is not seen again until he is reformed using the combined power of Dende and the spirit of Dendan using the power hidden inside piccolo and he is used to wish back Kilo and pan, also meaning he disappeared for the next year.
Zaecor then rampaged the earth for the next year, constantly getting into battles with the Z Fighters, until the day shenron returned.
He next returns just before Goku's final battle with Zaecor, and Zaecor wishes the rest of Shenron's pure power to join with him, which happens, making Zaecor into the most powerful warrior the Universe has ever seen. Everyone falls to his power, except Goku, who is able to hold his ground as super saiyan 5.
Goku then turns into the Kaioken Super Saiyan 5 x 1 million, allowing him to destroy Zaecor permanently, however this great energy he demands destroys going, turning him into a form of pure energy for a few seconds, before he explodes and the energy is scattered throughout time and space.. Only to be gathered again by Zaecor all those millions of years before.
Some residual energy still resides in other times, allowing Goku to temporarily reform himself, as seen in A Heroes Legacy when he meets Goku Jr