The central conflict of "The Avengers" is orchestrated by Loki, who makes a deal with a cosmic entity known as The Other, the servant of Thanos. In exchange for the Tesseract, Thanos provides Loki with the Chitauri army to conquer Earth. The major turning point in the film is the death of S.H.I.E.L.D. Agent Phil Coulson at the hands of Loki aboard the Helicarrier. Nick Fury uses Coulson's death as a manipulative tool to galvanize the fractured team, telling them they need something to 'avenge'. This lie provides the emotional impetus for the heroes to set aside their differences and finally unite as a team.
During the climactic Battle of New York, the heroes learn that Loki's scepter, which was used to mind-control Hawkeye and Dr. Selvig, can be used to close the portal he opened with the Tesseract. This is a critical discovery made by Black Widow. The film's ultimate climax sees the World Security Council override Fury's authority and launch a nuclear missile at Manhattan to contain the invasion. In a final act of heroic sacrifice, Iron Man intercepts the missile and flies it through the portal, destroying the Chitauri mothership and deactivating their entire army on Earth. He nearly dies in the process but is saved by the Hulk. In the aftermath, Thor takes Loki and the Tesseract back to Asgard. The mid-credits scene reveals the true mastermind behind the invasion: the Mad Titan, Thanos, setting up the overarching conflict for the subsequent phases of the MCU.