In Marvel’s comic book universe, the imposing purple villain Thanos only wants one thing: Absolute control of the universe. It’s an ambitious, however simple goal from a seemingly simple comic book bad guy, and it will be told on the big screen this Friday in Avengers: Infinity War. But the impending Marvel film has a much stranger, and more personal, origins for creator Jim Starlin. In 1991, Starlin wrote The Infinity Gauntlet for Marvel, a six-issue series that now serves as the primary inspiration for the blockbuster film that wraps up ten years of interconnected movies. Here’s how we got from there to here.

It all begins in a psychology class Starlin took in junior college.

After being discharged from U.S. Navy service after the Vietnam War in 1971, Detroit native Jim Starlin took up odd jobs and attended college courses, sending submissions to comic book publishers like Marvel and DC in his spare time. “Nothing but rejection letters,” Starlin recalled in a recent Vulture interview. At some point, Starlin had a crush on a woman, and took a psychology class to impress her. There, Starlin learned about Sigmund Freud’s theories on the concept of “Thanatos,” or man’s inclination to self-destruct.

Wrote Vulture in a 2018 profile:

“ … Starlin was tasked with drawing an issue of The Invincible Iron Man alongside his friend and housemate, the writer Mike Friedrich. He had just the idea for it. While attending a psychology class in junior college in order to woo a woman, Starlin had become briefly acquainted with the Freudian concept of Thanatos, humanity’s drive for death and self-destruction.

“As a result, even before he started at Marvel, he’d drawn up plans for a villain named Thanos, using that subtracted spelling ‘because it ‘looked’ better in print.’”

Thanos Infinity War
Thanos, as he appears in the Marvel film franchise played by Josh Brolin.

In 1973, Starlin had gotten a gig at Marvel and was able to bring Thanos to life for the first time in Invincible Iron Man #55. Decades later, and after one of Stralin’s many falling-outs with Marvel, Starlin wrote new Thanos comics, including 1990’s The Thanos Quest in which Lady Death resurrects Thanos, who learns about the Infinity Gems and begins his quest to gather them all.

The sales of Thanos Quest encouraged Marvel to ask Starlin for a follow up, which resulted in 1991’s The Infinity Gauntlet. In that six-issue series, Thanos had become fond of Lady Death, and sought the power of the Gems to make her fall in love with him.

Starlin insists Thanos’s crush on Death came independently and does not mirror his days in college. “No, had to go through a few other relationships before that idea perked to the surface,” he told Inverse in a brief email. He said as much in a 2012 interview with Hero Complex: “Not sure where his loving Death came from. At the time I was recently out of the service and rather messed up. Hard to remember what was going through my head back then.”

Modern readers may also be surprised to know that various Marvel editors resisted at having certain characters involved with The Infinity Gauntlet, at least the first time around. “Most of them didn’t want me using their characters, especially the X-Men editor,” Starlin told SYFY in a video interview from February 2018. He continued:

“That’s why we were limited to Wolverine, and Cyclops, maybe. We got the book and it sold well. Later on when we did The Infinity War, which was the sequel, instead of everyone trying to keep their characters out, everyone was insisting that we jam them in. And it was really a nightmare.”

Avengers Infinity War
From 'The Infinity Gauntlet' #1. Art by George Perez, Josef Rubinstein, Tom Christopher, Max Scheele, and Ian Laughlin.

Big comic crossovers, which are very common today, were pretty normal even just 25 years ago when The Infinity Gauntlet came out. It was in 1984, seven years before Gauntlet, when Jim Shooter set the standard at Marvel with Secret Wars. A year later DC did its own epic, Crisis on Infinite Earths by Marv Wolfman and George Pérez. But Gauntlet had one important fan: Joss Whedon. And when the Buffy creator directed 2012’s The Avengers, Whedon was free to include Thanos in the mid-credits scene, a decision that would result in billions in box office revenue over the years.

“He for me is the most powerful and fascinating Marvel villain,” Whedon told Slashfilm in 2012 about Thanos. He added:

“He’s the great grand daddy of the badasses and he’s in love with death and I just think that’s so cute. For me, the greatest Avengers was The Avengers annual that Jim Starlin did followed by The Thing 2-in-1 that contained the death of Adam Warlock.

“Those were some of the most important texts and I think underrated milestones in Marvel history and Thanos is all over that, so somebody had to be in control and had to be behind Loki’s work and I was like ‘It’s got to be Thanos.’ And they said ‘Okay’ and I’m like Oh my God!’”

It’s unknown what Marvel’s next moves are after Infinity War. There’s plenty of room to speculate “Phase 4,” which will happen in a future where Fox properties like the X-Men and Fantastic Four will be back at home under Marvel Studios. There’s talk of other characters, like Nova and Moon Knight, getting movies too. And there are obvious sequels, like Black Panther 2 and Guardians of the Galaxy Vol. 3. But until the future is known, the arrival of Thanos is the be-all, end-all of epic finales.

Avengers: Infinity War will be released on April 27.