***THIS POST CONTAINS SPOILERS FOR EVERY MARVEL MOVIE***
Alright, so in the Marvel Cinematic Universe, Asgard is sort of like the closest thing there is to a galactic governing body.
When we first get introduced to Asgard in Thor (2011), it's being ruled by Odin and his two piece of shit whiny baby adult sons.
Odin watches over the nine realms and, because he's a fairly smart, godlike being, has a vault full of stuff that can destroy the universe.
Helping Odin watch over the nine realms is Heimdall, literally the only responsible Asgardian. He has the ability to see and hear everything in the universe and he guards the entrance to Asgard, called the Bifrost.
Until these two absolute clowns got involved, Odin and Heimdall guarded over the universe and made sure extinction-level events weren't a regular occurrence.
In Thor, everything goes ass-up when Loki secretly has a bunch of Frost Giants show up to attack Asgard because he's mad at all the attention his dad is giving Thor.
Which makes Thor have a big idiot tantrum because the Frost Giant attack ruins his coronation. Then Loki manipulates Thor into going over to where the Frost Giants live and beating everyone up.
Odin finds out that his idiot son has violated a centuries-old peace treaty and banishes Thor to Earth.
*Nordic angst intensifies*
Meanwhile, back on Asgard, Terrible Son #2 becomes king and Odin goes into a thing called Odinsleep. Basically, a really long magical nap.
Loki stirs up a whole bunch of drama with the Frost Giants, tries to kill Odin, and also sends a big robot to go kill Thor, who's still stuck in New Mexico.
Thor fights Loki's big robot and they destroy a bunch of gas stations or whatever. Thor defeats the robot, goes back to Asgard, and tries to stop Loki.
Which destroys the Bifrost Bridge.
And sends Loki hurdling through space.
Right, so after causing all that completely unnecessary drama, Loki decides he's not done being a complete dick and makes a deal with Thanos in the beginning of The Avengers (2012).
Loki and Thanos make a pact that would let Loki rule Earth in exchange for him getting Thanos the Tesseract, which holds the Space Stone. Thanos gives Loki a Scepter that contains a second Infinity Stone, the Mind Stone, which controls people's minds and tells him to go nuts.
The Tesseract with the Space Stone, if you'll recall from Captain America: The First Avenger, has been in S.H.I.E.L.D.'s custody ever since they took it from Hydra way back in World War II.
Loki uses the Mind Stone to get the Space Stone and opens up a portal above New York.
Which means this happens.
And this happens.
By the end of The Avengers, Thor has both the Space Stone and Loki locked up. Except Thor, being a giant idiot, leaves the Mind Stone on Earth, but we'll get to that in a sec.
After the Battle of New York, Thanos has now realized that the Earth isn't going to be an easy planet to conquer, so he's got to really step up his game if he wants to take on the Avengers.
Until he uses the chaos around Thor's battle with the Dark Elves to usurp Odin's throne AGAIN. He uses his glamour abilities to convince everyone he's Odin and banishes his father to Earth.
When Thor shows up back on Asgard in Thor: Ragnarok, he obviously immediately clocks that Loki is pretending to be Odin and calls him out for it.
Which would be fine except the real-world time between MCU movies is roughly in sync with the make-believe time that passes in-universe, which means Loki spends FOUR YEARS pretending to be Odin.
Where's Thor this whole time? Still cleaning up Loki's fucking mess. Pretty much everything that happens in Avengers: Age of Ultron is Loki's fault.
And then, because Thor is as worthless as his brother, he takes a magic bath and inadvertently makes Robot Jesus over here.
We learn in Thor: Ragnarok from Hela that the Infinity Gauntlet that's supposed to be chilling safely in Odin's vault this whole time is actually a replica.
And in Avengers: Infinity War, Thor, Rocket, and Groot head to one of the Nine Realms, Nidavellir, and find out that Thanos has killed all the dwarves there and used their forge to make the real Infinity Gauntlet.
We see the same very real Infinity Gauntlet in an Age of Ultron post-credits scene in which Thanos says, "Fine, I'll do it myself." Age of Ultron is about two years into Loki's rule as fake Odin.
The minute Thanos got to Nidavellir, Heimdall would have been able to see it and would have been able to tell Odin. EXCEPT when Loki takes over Asgard, he replaces Heimdall with Skurge, possibly the dumbest Asgardian of all.
This means: During the four years when Heimdall isn't guarding the Bifrost and Odin is banished on Earth, Thanos is making moves.
And what's Loki doing this whole time?
Forcing Matt Damon to do weird plays!
So let's summarize every dumb thing that Loki has done by the time we see him in Infinity War, shall we?
Oh, and here's one last one for you. The Tesseract could have been destroyed in Thor: Ragnarok, which would have meant that Thanos wouldn't have been able to finish the gauntlet, except Loki stole the Tesseract off Asgard, brought it onto the Asgardian refugee ship, and got everyone killed.
Oh my god, I'm just realizing this as I'm writing this: The Avengers' fight with Ultron inspires the Sokovia Accords, which is what divides the team in Captain America: Civil War, which is why when Thanos's Black Order goons show up on Earth in Infinity War, they aren't ready for him.
Anyways, there you go — one emo fuckboi caused the annihilation of half the known universe because he was mad at his dad.