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.