While the original war between the creations of the Quintessons, the Autobots (slave robots) and the Decepticons (military robots), had ended with the Decepticons' defeat, several million years later, new robots were built by the Transformers who were living in peace on the planet, with the power to fly in robot mode. Megatron was the first of these (Reports, quite possibly erronious, indicate that a group of robots known as the Constructicons built Megatron (Ref: "Five Faces of Darkness"), although considerable obscurity surrounds this groups origins also). Immediately disgusted with his idyllic surroundings, Megatron sowed the seeds of rebellion amongst the new Decepticons who were created after him. Believing that the Decepticons should rule over the Autobots, Megatron duped a young Autobot worker named Orion Pax into allowing him access to an Energon warehouse. Megatron and the Decepticons then turned on Pax, and blasted him repeatedly. While Megatron escaped with the Energon, the comatose and dying Pax was taken to the Cybertronian machinesmith, Alpha Trion, and rebuilt into the wise and powerful Optimus Prime. The war that ensued between the Autobots and Decepticons was fierce, with Prime and Megatron dedicated to the destruction of the other. Megatron's mercilessness and brutal methods earned him the title "The Slag-Maker".
As the Decepticons slowly took control of Cybertron, the war was put on hiatus, as both factions realised that their planet's energy sources had all been depleted. Optimus Prime hit upon the idea of searching out other planets rich in energy, but Megatron wanted the energy for himself. Setting out in their spaceship, the Ark, the Autobots were ambushed by the Decepticon flagship, the Nemesis, with Megatron at it's helm. The Decepticons boarded the Ark, and it went out of control, caught in the gravity of the third planet in the Sol system. The Ark crashed into a dormant volcano, where it lay for four million years, all the Transformers within deactivated by the crash, until a freak eruption reactivated it's computer, Teletran One, in 1984. Teletran One then reactivated the Autobots and Decepticons indiscriminately, and the war continued on Earth.
Megatron was given the ability to transform (shrinking as he does so) into the likeness of an earthen Walther .P38 pistol.
In this mode, he uses the fusion cannon he is armed with in robot mode to channel immense blasts of energy. This cannon is one of the most powerful weapons known to the Transformers - as well as being devastating in it's own right (it is capable of blasting holes in solid rock deeper than Autobots are tall, for example (Ref: "Changing Gears") ), Megatron is also capable of using his internal circuitry to link the cannon to a black hole in space, producing a much more powerful effect. However, this leaves Megatron severely weakened.
Ever since his reawakening, Megatron has striven to capture all of Earth's energy for himself, and to destroy the Autobots in the process. His various schemes have included: Stealing the molten energy of Earth's core (Ref: "Fire on the Mountain" and "The Core"); Pulling Cybertron into Earth's orbit (Ref: "The Ultimate Doom"); various attacks on power plants and other commercial sources of energy (Ref: "More Than Meets The Eye", "Megatron's Master Plan" and more), using the advanced technology of Atlantis (Ref: "Atlantis, Arise!") and many, many more.By the Earth year 2005, Megatron's schemes had succeeded, and, following a number of smaller victories, the Decepticons managed to conquer all of Cybertron. The Autobots, operating from bases on Cybertron's moons, sent a shuttle to Earth to collect energy from Autobot City, to power the forthcoming assault on Cybertron. History repeated itself, as the Decepticons ambushed the shuttle - however, this time, the Autobots piloting it, Brawn, Ratchet, Ironhide and Prowl, did not survive the experience, as they were brutally killed by Megatron. The Decepticons then piloted the shuttle to Earth, and launched a massive assault on Autobot City. Thanks to a radio message from Blaster, Optimus Prime arrived on Earth with reinforcements. Cutting a swathe through the Decepticon forces, Prime confronted Megatron in a ferocious battle royale. Prime had the upper hand, until the youthful Autobot Hot Rod interfered, attempting to prevent Megatron from catching Prime off guard, and Megatron blasted Prime through the stomach. With the last of his strength, Prime inflicted mortal damage to Megatron also. The Decepticons retreated, as Optimus Prime... died.
On the return journey to Cybertron, Megatron's traitorous lieutenant Starscream took his opportunity to usurp leadership of the Decepticons, and cast the wounded Megatron out into space, along with other critically injured Decepticons. However, Megatron did not die. He was recovered by the monster planet known as Unicron, and struck an uneasy bargain with the planet-eater. In exchange for Megatron's destruction of the Autobot Matrix of Leadership, Unicron would rebuild Megatron's damaged body, and give him new troops. By the power of Unicron, Megatron was truly tranformed - into Galvatron!
(Further information on Galvatron may be found in his own profile).