The Ambush in Knowhere was a trap set by Thanos, who planned to obtain all six Infinity Stones. By attacking Knowhere, he was able to obtain the Reality Stone and gained the attention of his adopted daughter Gamora, who knew the location of the Soul Stone. Thanos retrieved the stone and then used it to trick the Guardians of the Galaxy and kidnap Gamora.
In the aftermath of the Second Dark Elf Conflict, the Aether, which actually was the Reality Stone in a liquid state, was given to the Collector on Knowhere by the Warriors Three, as the Asgardians, who already possessed the Tesseract, considered that they could not store two Infinity Stones on Asgard.
However, the Titan Thanos soon sought to acquire all the Infinity Stones into his Infinity Gauntlet so he could fulfill his plan of wiping out half of all life in the universe. Along with the Black Order, Thanos began a quest for the Infinity Stones, stealing the Power Stone from Xandar and the Space Stone from the Asgardians when he attacked their spaceship the Statesman, leaving Thor to die. Thanos then instructed his children to go on Earth to secure both the Time Stone and the Mind Stone while he would go to Knowhere to find the Reality Stone. He eventually stole the stone from the Collector, which was in the form of the liquefied Aether, and he solidified it into the Reality Stone with the Power Stone.
However, Thor managed to survive Thanos' attack and the destruction of the Statesman, and was rescued by the Guardians of the Galaxy, who answered the Statesman’s distress call. Thor informed them of Thanos' plans, deducing that Thanos was headed to Knowhere next to retrieve the Reality Stone.
While Thor, Rocket and Groot left for Nidavellir to forge a weapon capable of stopping Thanos, Star-Lord, Drax the Destroyer, Gamora and Mantis decided to track Thanos to Knowhere in an attempt to find and stop him. During the journey, Gamora, who secretly knew the location of the Soul Stone, asked Star-Lord to kill her should she be captured by Thanos to prevent the knowledge she carried from falling into his hands.
Upon arriving at Knowhere, the Guardians of the Galaxy found the entire colony almost completely deserted and untouched. Detecting movement in the third quadrant of the colony, the heroes landed their ship nearby and began to investigate.
As they approached, the group found Thanos brutally interrogating the Collector for the whereabouts of the Reality Stone. Despite Star-Lord's attempts to command them to hold a position, they continued to close in on Thanos, hiding behind the remnants of the Collector's museum to spy on the Mad Titan. Unaware of their presence, Thanos continued to question the Collector, who swore that he had sold the Reality Stone, being unaware of its true nature, something that Thanos found hard to believe.
However, due to having lost his wife Ovette and his daughter Kamaria at the hands of Thanos' campaign, Drax the Destroyer almost compromised the Guardians' position due to his anger, preparing to attack Thanos head-on. Star-Lord attempted to convince him to wait, noting that Thanos did not have the Stone yet, thus they could still take it from him before he realized what had happened. His attempt was unsuccessful, however, with Drax ignoring Quill, and Mantis was forced to render him unconscious in order to prevent him from blowing their cover.
Unfortunately, the sound of Drax collapsing on the ground drew Thanos' attention anyway, and he threw the Collector into a tank before advancing towards the Guardians. Before Star-Lord could give combat instructions to Gamora and Mantis, Gamora swiftly attacked her father without waiting, engaging in melee combat with her sword Godslayer. However, while Thanos managed to destroy Godslayer, Gamora fatally stabbed him in a swift move, with the remains of Godslayer and the switchblade Thanos had offered her as a child. Thanos appeared to quickly bleed out from his injuries, astonishing the other Guardians and the Collector. The Titan pleaded with Gamora, heartbroken that she would murder him with his own gift to her, before succumbing anticlimactically to his injuries, as Gamora wept for his death.
Nevertheless, Thanos' voice was still heard in spite of the Titan's apparent death, noting that Gamora's tears indicated she still cared for him to an extent. As the dead Titan and the surrounding Knowhere began to dissolve in a red mist, revealing a burning wasteland, Thanos' trickery was finally revealed: The Titan had already laid waste to Knowhere and retrieved the Reality Stone, conjuring an elaborate illusion using the Stone to lure in his adopted daughter.
Thanos soon appeared himself, commenting that while reality was often disappointing, with the power of the Reality Stone, this no longer held true. Indeed, Thanos needed Gamora to disclose the location of the Soul Stone, being the only one who knew its whereabouts, telling her that he counted on their arrival and that they needed to discuss something.
Gamora immediately attempted to attack Thanos, but was quickly restrained. Enraged, Drax broke his cover and tried in vain to assault the Titan, only for Thanos to simply smirk at Drax and immediately incapacitate him with the Reality Stone, turning him into lifeless bricks. Terrified, Mantis inadvertently revealed herself, causing Thanos to transform her with the Stone as well, cutting her into still-conscious ribbons of flesh. It was at this point that Quill himself intervened.
Thanos recognized Quill as Gamora's lover. Star-Lord fruitlessly demanded that Thanos release Gamora, threatening to kill him. However, Gamora reminded him of his promise to kill her if she was ever captured by Thanos. Reluctantly, Quill pointed his Quad Blaster at Gamora, though Thanos was skeptical that Quill would have the courage to follow through on his promise.
But, as they confessed their love to each other, Quill finally pulled the trigger. However, the Blaster merely fired harmless bubbles - Thanos had preemptively transmuted the blaster's ammunition using the Stone, before transmuting the blaster itself into bubbles. Impressed with Quill for having the courage to do what was necessary, Thanos teleported himself and Gamora away with the Space Stone, leaving an astonished Quill behind with the broken Godslayer, as Drax and Mantis reconstituted themselves in the absence of the Reality Stone's effects.
Thanos brought Gamora aboard the Sanctuary II and revealed that he had captured Gamora's sister Nebula. He then forced Gamora to reveal the location of the Soul Stone, torturing Nebula until Gamora answered. Although Gamora tried to resist, she could not bear to hear her sister screaming in pain and quickly told Thanos that the Soul Stone was located on Vormir. Thanos then took Gamora to Vormir, where he would soon learn from its keeper that he would have to sacrifice what he loved the most, which was Gamora herself, in order to obtain the Soul Stone. He reluctantly and sadly did so, thus resulting in the death of the first Guardian.
Nebula eventually escaped from the Chitauri guarding her and managed to contact Mantis, instructing her to meet on Titan, Thanos' homeworld. Therefore, the Guardians of the Galaxy flew to the barren satellite hoping to find Gamora, where they instead encountered Iron Man, Spider-Man and Doctor Strange. Although they at first mistook them for Thanos' minions, they quickly realized that they all pursued the same objective of stopping Thanos, and decided to form an alliance. It would, however, prove to be insufficient to thwart the Mad Titan's plans, as the knowledge of Gamora's death would cause an enraged Quill to attack Thanos, blindly, jeopardizing the plan and allowing Thanos to overpower them. This would eventually end in almost all the Guardians being erased from existence with only Nebula and Rocket surviving.