The entity known as the Guardian of Forever is an enigmatic mystery that affected the past and future of Starfleet and the Federation.
The Guardian originally appeared as a large oddly shaped stone portal in the ruins of an ancient city on a planet that the Federation named "Gateway". It was discovered because of it's effects on nearby space (in the form of spatial ripples and abnormalities) in the area that the Tkon Empire used to occupy. The ruins of the city nearby dated back over one million years but the Guardian countered that the civilization was older than the Sol. When speaking, it generated flashing lights and fog when someone entered its portal.
Interaction with the Enterprise
In 2267, the Enterprise investigated the spatial distortion waves to their source on the Gateway planet, where Spock described the waves as “ripples in time”. Because of an accidental overdose of cordrazine, Dr. McCoy went temporarily insane with paranoid delusions and he beamed to the surface of the planet and escaped through the Guardian into 1930s Earth. The Guardian allowed Kirk and Spock to enter the gateway to repair damage done to the timeline by McCoy.
In the past, while awaiting the arrival of McCoy, Kirk fell in love with Edith Keeler, who turned out to be the very life that the Doctor saves, changing the course of history. His actions of saving her caused a delay in America’s involvement in World War II which allowed the Nazis to finish developing nuclear weapons, and with them, finish conquering the world. To make sure history progressed as it should, Kirk stopped Dr. McCoy from saving Edith Keeler's life which righted history.
The three then re-entered the gateway and emerged back in the present only moments after they had left.
In 2269, a team of Historians along with Captain Kirk and Spock used the Guardian to investigate Federation history. Doing so led to the unintended consequence of removing Spock from the timeline. The Guardian allowed Spock to go back to his childhood and save his younger self during the Kahs-wan ritual.
The Temporal Wars were started by Vosk of the Na'kuhl, a pale, hairless humanoid alien species with a pale white complexion, red eyes, and yellowish-brown blood. They felt that time travel was an inherent right of theirs, despite any damage they caused to the timelines.
The battles that occurred over time and space caused the Guardian to move from its original home to Dannus V to keep would be Temporal Time Warriors from having access to the Gateway.
In 3189, The Gateway adapted to appear differently than it had previously. And it took on a human-like appearance without a static doorway. This camouflage lead a traveler to believe that it wasn’t the Guardian but perhaps a Q or other type of higher being. This was done as a protection to keep visitors from using the Guardian in pursuit of any Temporal War goals.
The Guardian appeared to Phillipa Georgiou and Michael Burnham of the USS Discovery, as Carl (a short, plump, middle-aged human in 20th-century garb) holding a newspaper with the headline announcing the impending death of Georgiou on it. He offered her a chance to continue living by walking through a large wooden door which turned out to be the Gateway. She did and was transported to the Mirror Universe where she learned that she was a changed person. She was not the same Emperor that used to rule the Mirror Universe, and she was not the same Georgiou. Eventually, her love of Burnham and the rest of the crew of the Discovery that she’s reluctantly come to love forced her to realize that she no longer had a home in the mirror universe. She emerged from the Mirror verse, still dying but ready to acknowledge her feelings for Burnham and the others. Carl, the Guardian, offered to send Georgiou to a place and time before the Prime and Mirror universes drifted apart, that would save her life and she accepted. Before she fully walked through, Georgiou turned and told Burnham, "This era is different, more Terran than where you came from. Saru has navigated Discovery admirably....But he's not the only one who's suited for the Captain's chair. You have always been far greater than you could imagine, Michael." She then walked through the Gateway and disappeared into time.