Mata Nui was the Great Spirit created by the Great Beings of planet Spherus Magna, to explore and observe the galaxy. His physical form was that of a giant robot constructed by the Great Beings. For a time, he was condemned to an eternal slumber by the evil Makuta Teridax. Many Toa, warriors originally created to protect him and his Matoran inhabitants in such an emergency, embarked on journeys to revive him. Upon Mata Nui's death after the Toa Mahri ultimately failed to save the universe, Toa Matoro sacrificed himself, dying so that Mata Nui could live again. With Mata Nui alive once more, Toa Tahu and his allies journeyed to Karda Nui to finally awaken the Great Spirit, said to be the destiny of the Toa Mata. While they narrowly succeeded in doing so, Makuta Teridax took control of the Matoran Universe and trapped Mata Nui's spirit inside the Kanohi Ignika, the Mask of Life, before blasting it into outer space.
The Ignika eventually landed on Bara Magna, a remnant of the since-shattered Spherus Magna, where it unleashed Mata Nui's spirit and created a body for him. Now a fully physical being, Mata Nui earned the trust of the native Glatorian, warriors similar to the Toa, and together they allied with the inhabitants of the Matoran Universe to combat Teridax and his forces of Rahkshi, Skakdi and Skrall. Using an ancient Prototype Robot, Mata Nui fought Teridax on Bara Magna before finally managing to kill him, by impacting the head of the Great Spirit Robot against the falling moon, Bota Magna. With the threat extinguished, Mata Nui used the last of his power to make Spherus Magna whole once more, and this caused his spirit to return to the Ignika. As he said goodbye to Tahu and those surrounding him, he encouraged them to begin a new life on Spherus Magna.