Thanos had been searching for the Infinity Stones for quite a while in the Marvel Cinematic Universe before acquiring all of them in Avengers: Infinity War. Marvel Studios had been teasing the existence of the Mad Titan as early as 2011's Thor. He appeared in a string of films since then, hinting that he was after all six elemental crystals, but it wasn't until Infinity War that it became clear what his plans were.
Ever since physically appearing during The Avengers' post-credits scene, fans presumed that the Infinity Stones would factor in the franchise's long-term narrative plans. By Avengers: Age of Ultron, Marvel Studios officially laid the seeds for the culmination of the Infinity Saga with the Mad Titan deciding to look for the gems himself. Considering what's known about his arc in the MCU, he was already working on collecting the gems via surrogates such as Loki (Tom Hiddleston) and Ronan the Accuser (Lee Pace), and chances are that he was further motivated after Odin's (Anthony Hopkins) death. But his efforts in acquiring the crystals more likely preceded his first appearance in the universe.
Related: Iron Man's Alternate Final Line Would've Ruined His Perfect Endgame Death
Despite being the primary villain of the Infinity Saga, much is still unknown about the Thanos (Josh Brolin). But based on what's known, after the destruction of Titan, the villain went on a quest to balance the universe in an effort to save it from the same fate as his home planet. When he got to Gamora's world, Zen-Whoberi, he was still executing his plans manually, leaving his minions to kill half of the planet's population. At this point, Gamora was around the age of 10, creating a roughly 20-year period between her abduction and Thanos
Read more on screenrant.com