Four years after Iron Man launched the Marvel Cinematic Universe, Joss Whedon gave audiences The Avengers, the final installment of the MCU's Phase One and a cinematic team-up that comic book fans has previously only dreamed of. The main story saw Earth's Mightiest Heroes dealing with Loki, his mind-controlled operatives and eventually his Chitauri army. However, The Avengers' mid-credits scene introduced us to Thanos, who smirked when his underling, The Other, told him that to challenge Earth's heroes would be to court death. It was our first clue that a larger story to be told across the entire MCU, but Whedon has now admitted that when he included Thanos in The Avengers, he didn't know what to do with the character overall. Whedon explained:
Honestly, I kind of hung [Thanos] out to dry. I love Thanos. I love his apocalyptic vision, his love affair with death. I love his power. But, I don't really understand it. He's had a lot of power, and he was cool in the comics. And I'm like, Thanos is the ultimate Marvel villain! And then I was like, I don't actually know what I would do with Thanos. So, I liked what [the Russo brothers] did so much, and I thought Josh Brolin killed it. And they did an amazing job of keeping that performance on-screen. But it wasn't like I was like, here's a set of directions. I was like, I'm gonna get through Ultron, nap for four years, and then I'll come to the premiere. Which I did! It was like, this is so cool!
Like most Marvel Comics fans, Joss Whedon was familiar with Thanos, but just because you know about a character doesn't mean you necessarily understand their deeper characterization. So when Whedon was working on The Avengers, he made the decision to have the Mad Titan cameo at the end, but he didn't have a specific plan in mind for him at the time. Whedon managed to sidestep Thanos again for Avengers: Age of Ultron, as Ultron (duh) was that movie's main antagonist and the mid-credits scene showed Thanos retrieving his Infinity Gauntlet so he could get the job of collecting the Infinity Stones done himself. Whedon was clearly aware that Thanos is a big deal in the Marvel mythology, but similar to his time on the Batgirl movie, he just couldn't figure out how to crack the code.
After Avengers: Age of Ultron, Joss Whedon departed from the MCU, and Joe and Anthony Russo, who had already shown off their MCU chops directing Captain America: The Winter Soldier and were being brought back to direct Captain America: Civil War, were tasked with helming Avengers: Infinity War and Avengers 4. Continuing in his interview with IGN, Whedon said he was pleased with how the Russos, and writers Christopher Markus and Stephen McFeely, adapted Thanos, noting that the Mad Titan's obsession with Death in the comics wouldn't necessarily work well in a movie. Whedon said:
I thought they did what they needed to do. [Thanos falling in love with Death is] not a concept that will necessarily translate. It's sometimes also an easy out for a villain. To say, I love destruction! No, really, I'm in love with it. And yet, you're still just a nihilist. Whereas they gave him an actual perspective and made him feel righteous to himself, which is always a better idea. So I liked what they did very much. I did not know about it, I certainly didn't come up with it.
Instead of wanting to impress Death like his comic book counterpart, the MCU's version of Thanos wanted to collect the six Infinity Stones in Avengers: Infinity War so he could wipe out half of all life in the universe so that it wouldn't be overwhelmed by overpopulation. Infinity War ended with him accomplishing this goal, but with Avengers 4 arriving next year and serving as the final chapter of Phase Three, his story isn't over yet.