Primus and Unicron
Before the Big Bang, an older universe existed, which was destroyed - consumed - by the fallen deity, Unicron. In the void of nothingness left in the universe's wake, Unicron slumbered, his work done... but Unicron had not been thorough enough, and tiny particles of the old universe that remained reacted with one another, birthing the current universe we know today. When Unicron awoke, his task began again, as he consumed world after world, until the sentient core of the universe responded by creating a guardian to battle Unicron - the Lord of the Light, Primus. Unfortunately, while Primus proved to be a physical equal, he was unable to outmatch Unicron in power. In a bid to save the worlds that they were destroying with the ferocity of their battle, Primus shifted the conflict to the astral plane, though he fared no better there than in the physical world. In a final gamble, Primus returned to the physical universe, with Unicron following on his heels, eager for the kill - unaware that Primus was luring him into a trap. Rather than materializing back in their corporeal forms, Unicron and Primus's consciousnesses became imprisoned in two metallic asteroids; Primus had sacrificed himself in order to capture Unicron.
However, Unicron was not beaten. After millennia, Unicron was able to psionically reshape his asteroid prison into a massive metal planet, and from there further developed his prison to be capable of transformation into a robot form which mimicked his original appearance, allowing him to continue his attempts to once again destroy all of creation. Primus followed suit, crafting his asteroid into a similar metal world - Cybertron. However, he did not wish to make the mistake of simply re-engaging Unicron in personal combat, as he believed their battle would continue to be a stalemate given their previous conflict. Instead, he gave birth to a race of beings called Transformers, possessed of transforming powers like Unicron's, and he bestowed upon them the Creation Matrix, a genetic Matrix that contained his essence, as capable of creating life as Unicron was of destroying it. Ultimately, the Matrix was intended by Primus to be a weapon intended to destroy Unicron, which would be wielded by Primus' creations against the evil entity. To hide his creations from Unicron before he felt they were ready to face him, Primus went into a hibernation-like sleep, his massive visage nestled at the planet's heart.
Knowing nothing of their true origins or the destiny they were to fulfill, the Transformers eventually splintered into two factions - the politically dissident Decepticons, who waged war on the peaceful Autobots. Megatron, leader of the Decepticons, schemed to turn Cybertron into the ultimate weapon, a warworld that would wreak havoc across the galaxy, and the resulting war knocked Cybertron out of its orbit and set it adrift in the universe. Around four million years BC, Cybertron's path brought it into the Sol system, heading directly for the asteroid belt, which threatened to heavily damage the planet. Autobot leader Optimus Prime led a contingent of his warriors aboard the Ark to destroy the rocks in Cybertron's path, but once they had succeeded, they were attacked by the Decepticons, causing all involved to be trapped in stasis on prehistoric Earth.
While the Autobots and Decepticons aboard the Ark were trapped on stasis, life on Cybertron continued. Consequently, the young warlord Trannis took control of the Decepticon army on the planet, and led a fierce campaign against the Autobots, reclaiming the cities they had taken, levelling the capital city-state of Iacon, and executing the Autobot council of elders, save for Emirate Xaaron, who fled with his troops and continued to fight. Xaaron formed an elite Autobot strike team, the Wreckers, who succeeded in assassinating Trannis, only to have the conflict escalate when the even more dangerous Lord Straxus took his place, forcing Xaaron and his men into hiding, fighting a guerilla war from a number of "Autobases" across the planet, headed up by Fortress Maximus and Perceptor, among others. Maximus's team, however, soon abandoned Cybertron, tiring of war and seeking peace on the planet Nebulos.
When the Transformers stranded on Earth were reactivated in 1984, the Decepticons succeeded in getting a message to Cybertron, and Straxus responded by arranging for the construction of a space bridge between the worlds. In a confrontation with Blaster aboard the bridge, Straxus's body was destroyed, leaving him a decapitated head, which in turn forced him to attempt the mental possession of Megatron's body. Megatron did not take kindly to this, and retaliated by destroying Straxus, leaving the Decepticon fuel auditor, Ratbat, as Cybertron's local Decepticon commander.
Little of import occurred on Cybertron in the immediate future as, more and more, the war spilled over to Earth, with the Autobot and Decepticon commanders summoning more and more warriors to the planet. Ratbat's death in the Underbase affair allowed a triumvirate of three Decepticons - Siezer, Legonis and Octus - to established themselves as rulers on Cybertron while Scorponok led on Earth, but following their destruction by Megatron, and his own subsequent disappearance, their appointed replacement, Thunderwing, took control and dispatched the Mayhem Attack Squad to track down the Autobot Pretenders. When the ensuing battle resulted in the malfunction of a teleportation portal, Grimlock, Bumblebee and Jazz found themselves at the core of Cybertron, bearing witness to the visage of Primus, and learned of his legend from the ancient "Keeper". The Keeper was then struck down by the Mayhems, and the battle that followed briefly awakened Primus, who unleashed a single scream that was heard on the fringes of known space... by Unicron.
As Unicron bore down on the planet, he sent an agent, Galvatron, ahead to sow terror in his name. But Galvatron chafed in Unicron's service and instead awoke Primus, who possessed Emirate Xaaron and teleported every Transformer back to Cybertron in order to unite them, as Unicron attacked the planet. Although Optimus Prime was able to use the Creation Matrix to destroy Unicron, it seemed that Cybertron was to meet its end by other means - tremors and storms began to pervade the planet, which seemed to be tearing itself apart, forcing the remaining Autobots and Decepticons to flee. In actuality, however, the final wave of Matrix energy released in Unicron's destruction had begun a planet-wide rebirth, which was then guided to conclusion by the Last Autobot, restoring and regenerating Cybertron, which the Autobots then occupied.
Read more about this topic: Cybertron, Transformers: Generation 1