The Battle of Earth was the culminating battle for the fate of the planet and the entire universe, fought among the Avengersand their allies united, against alternate timeline versions of Thanos, the Black Order, and their full arsenal of Outrider, Chitauri, and Sakaaran armies.
The monumental scale of the battle makes it one of the largest extraterrestrial conflicts in Earth's history.
The battle took place in the demolished ruins of the New Avengers Facility in New York, shortly after it was annihilated by Thanos' flagship, the Sanctuary II. After the Avengers, united under the banner of Captain America, rallied their own defenses in the Wakandans, Masters of the Mystic Arts, Ravagers, Asgardians, and the Guardians of the Galaxy, both sides collided to a head in a massive assault, fighting for possession of the Infinity Stones. Many casualties from both battlefronts resulted from the battle.
With both sides vying for supremacy, the tide turned in favor of the Avengers when Captain Marvel used her cosmic powers to destroy the Sanctuary II, which up until that point pinned down the Avengers and gave Thanos the tactical advantage. The battle came to a decisive close when Iron Man sacrificed his life to activate the completed Iron Gauntlet, wiping out Thanos and his armies, effectively avenging the resurrected trillions who previously perished in the Decimation, and ending Thanos' war on Earth.
During the War on HYDRA, when the Avengers attacked Wolfgang von Strucker's base in Sokovia, Tony Stark was induced a horrific vision by Scarlet Witch of the impeding Battle of Earth, where the Avengers laid either dead or mortally injured, and a swarm of Leviathans were descending upon the planet under Thanos' command.
Keeping this vision to himself, Stark became increasing fearful for the planet's safety. However, most of his efforts to protect the planet were mere stepping stones to place these grave events closer into motion, including the campaign against Ultron, the Avengers Civil War, and inevitably, the Decimation.
Attack on the New Avengers Facility
In 2023, five years after the Decimation, the Avengers began orchestrating a Time Heist to recollect the Infinity Stones from the past. During the Theft of the Power Stone, Thanos, from an alternate 2014 timeline, had learned from Nebula that the Avengers would defeat him, and reverse the Decimation.
Now fully convinced that the universe wouldn't be grateful for his actions and wouldn't let go of the past, he set off with a new plan to destroy the current universe with the Infinity Stones, and start fresh to create a universe which Thanos had deemed to be peaceful. He sent Nebula (from his timeline) to infiltrate the Avengers, and shrink the Sanctuary II to their timeline in 2023.
Following the Reversal of the Decimation, Tony Stark, Steve Rogers and Thor rallied themselves and confronted Thanos after he destroyed the New Avengers Facility with bombs fired from the Sanctuary II. Sending The Mad Titan incapacitated Iron Man and overpowered Thor, but Rogers proved worthy to wield Mjølnir and intervened.
Rogers was eventually overpowered and his shield was split in half. Meanwhile, 2014 Nebula took the Iron Gauntlet, only to be confronted by 2014 Gamora and 2023 Nebula, resulting into her being killed by her future self.
After being beaten by Thanos, all hope was fading until Rogers got a message over his communications from Falcon. Shortly after, portals created by Doctor Strange began to open up behind them, revealing the allies of the Avengers: the Guardians of the Galaxy, the Dora Milaje and the Wakandan tribes, the Masters of the Mystic Arts, the Asgardians and the Ravagers.
Heroes who were decimated by Thanos also returned: Black Panther, Shuri, Falcon, Doctor Strange, Drax, Mantis, Star-Lord, Spider-Man, Winter Soldier, Groot, Scarlet Witch, and Wasp. Heroes who were not decimated by Thanos also appeared to aid the Avengers in battle: Pepper Potts, donning a new blue-and-silver armor, Okoye, M'Baku, Wong, Valkyrie, Korg, Miek, Howard the Duck, Kraglin, and 2014 Gamora. The two sides held a short standoff before Captain America gave the call sign and the two sides collided.
A violent battle immediately begins between the Avengers, their allies and Thanos' army. Both sides collide with each other on the ground and in the air, as a giant Ant-Man punches a Leviathan to the ground. Iron Man and Pepper Potts fight together in the air, as Captain America and Thor trade Mjølnir and Stormbreaker as they fight off Chitauri.
Iron Man is ambushed by Cull Obsidian, but he is saved as Spider-Man grabs the Black Order member with his web and causes him to fall, with the giant Ant-Man crushing him to his death by stepping on him. Spider-Man checks on his injured mentor and tries to put him to speed on what happened after the reverse of the Decimation, but Iron Man interrupts him by hugging him.
Star-Lord fights off several Chitauri who begin to outnumber him, but he is saved by Gamora. Star-Lord is shocked to see Gamora alive, not realizing she is not the Gamora he knew and tries to kiss her which prompted Gamora to kick him. She shows disgust that he is the one she ends up forming a relationship with, and Nebula comments that it was either him or "a tree."
Chase for the Gauntlet
Hawkeye runs around carrying the gauntlet, asking Captain America what he should do with it. Captain America tells him to take the stones as far away as possible, and Hulk says the stones must return where they came from, but they realize that Thanos' attack destroyed their Quantum Tunnel. Ant-Man reminds the group that they have another tunnel to use, calling the horn of Luis' Van as Valkyrie spots its location in the air, deep in the side of where Thanos' army is.
As Captain America and Iron Man tell Ant-Man, with Wasp arriving by his side, to get the van started, they will hold off Thanos' army and deliver the stones to them. Iron Man meets up with Doctor Strange and asks if this is the outcome they win. Doctor Strange cannot tell him because if he does, it won't be. Ant-Man and Wasp arrive at the van but find it broken down, and Ant-Man is forced to hotwire it.
Thanos and the Black Order realize that Nebula is not answering their transmission, but immediately spot Hawkeye running away with the stones. With the Outriders closing in on Hawkeye, Black Panther drives them away and tells Hawkeye to give him the gauntlet as he fights through the Outriders to reach Luis' van. Thanos himself closes in on Black Panther but he is immediately confronted by an enraged Scarlet Witch, determined to avenge her lover's death and everything she lost because of him.
As Scarlet Witch holds off Thanos, Black Panther continues to transport the gauntlet. He is then stopped in his tracks by Ebony Maw, but Spider-Man arrives to take the gauntlet himself, activating his suit's "instant kill mode" to horde off the Outriders chasing him.
Destruction of the Sanctuary II
Thanos is quickly overpowered by Scarlet Witch, as he orders the Black Order to call an airstrike on the battlefield. Corvus Glaive protests, pointing out that their own troops will suffer the bombardment, but Thanos, on the verge of being overwhelmed, orders the attack regardless. The Black Order comply and call a rain of missiles on the battlefield, and Scarlet Witch is blown aside as well as the entirety of the Avengers and allies, with the Masters of the Mystic Arts summoning Tao Mandalas to protect the army from the attack.
Meanwhile Doctor Strange uses his powers to protect the army from a drowning of seawater approaching them after the airstrike caused a dam to break. As Spider-Man is being greatly outnumbered by the Outriders, he is saved by Captain America throwing him Mjolnir to hang on to, he is then grabbed by Pepper Potts in her Rescue Armor, who then gets on Aragorn who is being ridden by Valkyrie. All help him get closer to Luis' van. The Avengers' army is pinned down by the airstrike, but every weapon suddenly stops firing at them and aims at the sky.
Confused, Iron Man is told by F.R.I.D.A.Y. that something suddenly entered the atmosphere. Captain Marvel arrives and single-handedly destroys the Sanctuary II, ending the airstrike while a bewilder Thanos looks on.
Captain Marvel then flew down to Spider-Man, who greets her and she took the gauntlet from him, and as the two are approached by a large number of Outriders and Chitauri, they are immediately supported by Pepper Potts, Scarlet Witch, Mantis, Okoye, Shuri, Valkyrie, Wasp, Gamora, and Nebula who all assault Thanos' army and create a path for Captain Marvel. With Luis' van quantum tunnel restored, Captain Marvel takes flight making a beeline towards the Quantum Tunnel.
Thanos tries to stop her, but he is quickly stopped by Potts, Shuri, and Wasp. He then throws his sword at the van, destroying it, with the explosion sending Captain Marvel reeling back and leaving the gauntlet on the ground unsecured. Thanos and Iron Man wrestle for it, but Iron Man is immediately overpowered. Thor and Captain America try to assist, but they are also overpowered by Thanos.
The Culminating Standoff
Thanos retrieves the gauntlet and tries to put it on, but he enters a heated battle with Captain Marvel who is unaffected by Thanos' hits and completely overpowers him. Cornered, Thanos grabs the Power Stone from the gauntlet and uses its power to knock Captain Marvel off of him. Iron Man glances at Doctor Strange, who signals to him that this is the one outcome in which he knew they could win.
As Thanos puts on the gauntlet once more, a weakened Iron Man once again grapples with Thanos but is brushed aside easily. Thanos smugly puts on the gauntlet, boasting that he is inevitable and snaps his fingers. However, when nothing happens, Thanos quickly realizes that the stones had been taken out of the gauntlet and inserted into Stark's armor. Muttering the words "I am Iron Man", Stark snaps his fingers.