Loki Laufeyson was the biological son of Laufey, the ruler of the Frost Giants in Jotunheim, who was abandoned and left to die shortly
after his birth. Found by Odin, Loki was taken to Asgard and raised by him and Frigga as an Asgardian prince, along with Thor. When Thor was to be crowned King, Loki had sabotaged the coronation by letting the Frost Giants attack Asgard, thus leading Thor to seek vengeance on Jotunheim, which resulted in Thor's banishment to Earth and Loki finding out the truth about his heritage. Frigga gave Loki the throne when Odin had fallen into the Odinsleep; however, when the Warriors Three and Sif attempted to return Thor home, Loki was forced to try to stop them. Regardless, Thor returned from his exile on Earth and ended Loki's reign. With Odin disapproving of his actions, Loki allowed himself to fall through the deep abyss of space, entering a wormhole created by the sudden termination of the Bifrost Bridge.
Transported by the wormhole to Sanctuary, Loki encountered The Other who offered to serve under Thanos' command and gave him the Scepter. Loki was given command over the Chitauri army in order to conquer Earth, under the provision that Loki acquires the Tesseract for Thanos. Once he came to Earth, Loki managed to take possession of the Tesseract and used its power to open a wormhole above New York City and caused the Chitauri Invasion, but all of Loki's schemes were ultimately defeated by the Avengers. Thor returned him to Asgard as his prisoner, where Odin condemned him to spend the rest of his life in the Asgardian Dungeons as punishment for his crimes.
However, when Frigga was killed during the Sacking of Asgard, Loki was freed by Thor in order to defeat the Dark Elves led by Malekith who desired to use the power of the Aether to transform the universe into eternal darkness. During the fight against the Dark Elves in Svartalfheim, Loki faked his death, and, unbeknownst to everyone in the Kingdom, returned to Asgard and successfully removed Odin from the throne, taking his place as King where he remained for several years. During his reign, Loki continued to rule Asgard by sending Sif on missions to Earth to investigate the attacks of Lorelei and Vin-Tak.
Eventually, the return of Thor forced Loki to reveal his deception as the pair journeyed together to find Odin, arriving just in time to witness Odin's death. The loss of Odin allowed Hela, Odin's firstborn, to return from banishment and wage war against the Nine Realms. Loki found himself stranded at Sakaar along with Thor where Loki allied himself with the Grandmaster while Thor was forced to battle against Hulk. Despite trying to manipulate his way to freedom, Loki chose to side with Thor and the Revengers in a final battle against Hela, in which Loki summoned Surtur, who defeated Hela by causing Ragnarök and destroying all of Asgard.
During his final moments on Asgard, Loki took the Tesseract from Odin's Vault and in the wake of the Destruction of Asgard, chose to stay by his brother's side and support his ascension onto the throne. Consequences of his deal with Thanos would soon come back to haunt Loki, however, as the Mad Titan and his Black Order intercepted the Asgardians as they were making their way towards Earth. In the chaos that followed, Loki attempted to kill Thanos but ultimately failed. When Loki taunted Thanos by telling him that he would never be a god, the Mad Titan snapped his neck, finally killing the God of Mischief.