This is how Thomas tells Unicron's backstory goes in Thomas' Adventures of Transformers Prime Beast Hunters: Predacons Rising.
Ryan F-Freeman: I think a story is coming on.
[Evil Ryan uses his magic to make projections of the story of Primus and Unicron]
Thomas: Before the beginning, there was Primus and there was Unicron. One the incarnation of creation, the other of destruction. For eons, Primus and Unicron battled. The balance of power shifted between them more times than could be counted. Only by creating, The Thirteen, the original Primes who proceeded me, was Primus finally able to defeat Unicron, and cast him out. Primus became one with the very core of the our planet, Cybertron, creating life through the Well of the Allspark, while Unicron drifted through the cosmos aimlessly. Eventually due to gravitational force, debris from space gathered around the slumbering Titan, forming Planet Earth.
[Evil Ryan's projections fade]
Sci-Ryan: Wow. Cool light show. Does Ryan help Twilight when she comes back. If so, we could go back to Earth.
Evil Ryan: Ryan could be more useful as a prince too.
Ryan F-Freeman: Yup. Maybe I can tell you this one. In the olden times, people beleved that light was a gift by an unseen land by the name of Kingdom Hearts. But, Kingdom Hearts was protected by it's counterpart. The X-blade. Warriors wanted that light. That started a battle called the Keyblade War. One strong clash broke the X-blade into 20 bits. Seven of light and 13 of darkness. And the real Kingdom Hearts was consumed by the darkness. Never to pop up again.
Rainbow Dash: Wow.
Matau T. Monkey: Maybe I know Twilight can remember that story. A long time ago on the island of Okoto, all lived in harmony. It was a place of wonders and great landscapes. From the island's elemental forces, two brothers known as the Mask Makers created masks of power. Each brother had a special mask. Makuta owned the Mask of Control. And Ekimu the Mask of Creation. The brothers provided the islanders with many masks. But Ekimu's were the most treasured. His brother became envious and jealous and forged an evil plan. It was a law that a mask could never contain the power of more than one element. Otherwise it would become too strong and dangerous. But Makuta wanted to create the strongest mask of all time. The Mask of Ultimate Power. When Makuta put it on, it took control over him and the island began to shake and crumble. Realizing what his brother had done, Ekimu managed to knock the mask from Makuta's face. A shockwave rolled across the land and sent both brothers to an endless sleep. The masks were scattered all over the island. Waiting for a time when someone would come looking for them.
Pinkie Pie: Awesome!
Thomas: You remember that?
Matau T. Monkey: Yeah. Just in case if Megatron is dead, I'll bury his body in the icy legion of Okoto. Where's Master Ryan gone to?
[Meanwhile, Ryan looks around with Rainbine and hides behind a rock]
Ryan F-Freeman: Rainbine. What's your posision?
Rainbine: I think we are somewhere Unicron might be here.
Ryan F-Freeman: Why do I bother facing Galvatron? [looks on his communicator] Ryan to Twilight. Ryan to Twilight. Do you read? Over.