The Time Matrix is a spherical device created by the Ellimist, which allows the user to travel through time and space. In addition, the user can alter reality itself even without time travel, making people remember things that did not happen. Should the user request something entirely detached from reality, it has the power to send the user to a new universe specifically created for them.
The Time Matrix was hidden in one of Earth's pyramids, where it was eventually found by the Skrit Na. The Skrit Na, not realizing what they had, sold it to the Yeerks. However, the Andalite ship Jahar found out about it and went to claim it. They had nearly escaped Yeerk territory with it, when a series of events forced Elfangor- who was serving aboard the ship-, Loren- who had been on board the ship while it was travelling-, and Visser Thirty-two- who had recently boarded the ship- to use it to escape the Jahar after it was damaged. However, their shared attempts to use it resulted in a new world being created that combined Earth with the Andalite and Yeerk homeworlds, along with various flaws (Such as Elfangor's home scoop being empty, Loren's mother knowing about Andalites, and an employee at a McDonald's Loren regularly visited possessing a red, distorted eyeless face due to Loren only ever focusing on his terrible acne whenever they met), before Visser Thirty-Two was forced to leave through a dimensional distortion that apparently returned him to the Jahar (Although it was later revealed that the Ellimist or another power saved him to preserve his place in history). Loren and Elfangor subsequently used the Time Matrix to escape to Earth- Elfangor feeling that he could no longer return to his people as he couldn't trust them with the Time Matrix-, where Elfangor hid the Time Matrix once more, in an abandoned construction site.
The Time Matrix was later found by Visser Four, who tried to use it to mess with human history in an attempt to make Earth easier to dominate. His actions were essentially successful, starting with him altering the outcome of the Battle of Delaware and going on to make other changes, culminating in humanity having slavery by the twentieth century and ignorant of the very idea of DNA. However, it violated the rules of the game played by the Ellimist and Crayak, prompting Crayak to allow the Animorphs to go after him through time, restoring their original memories and 'buffering' their personalities so that they would be immune to changes in history. Cassie was able to then fix the timeline by travelling back to the 1970s, preventing Visser Four's host from being born by distracting his mother when she was due to enter a store and meet his father, thus negating his existence and therefore his Yeerk's actions.