When Iron Man sacrificed himself to rescue the universe from Thanos in Avengers: Endgame, it wonderfully set up No Way Home’s conclusion. RDJ’s Tony Stark offered his life to use the Infinity Gauntlet to stop Josh Brolin’s Mad Titan from obliterating all of creation for his warped vision of the Greater Good in the MCU Phase 3 event movie. He finally fulfilled his role as Spider-Man’s mentor at that moment.
Most of Tom Holland’s Spider-Man lived in the shadow of Iron Man, even though Stark’s tech-enabled quick enhancements to Parker’s handmade costumes. With Spider-Man’s ability to pilot his own MCU tale being questioned, Stark stepped in as Uncle Ben, giving Peter sound counsel and trying to keep him in line.
In the end, Stark had to combine the practically parental sentiments he had for Peter with his trademark volatility and some deeply unsuitable decisions due to his own faults. By making Spider-Man an Avenger too soon, he not only equipped his suit with an instant kill mode.
Iron Man’s death allowed Spider-Man to emerge from Tony Stark’s shadow. However, even so, his old mentor had a significant impact on Peter’s life. This leads to the Mysterio narrative of Far From Home. Peter was also labeled as the “next Iron Man” because of this. Whatever his future holds for him, Spider-Man’s self-imposed exile in NWH has made him more like Iron Man than he’s ever been before.
Peter Parker’s selfless decision to erase himself from the minds of his loved ones in order to save the universe feels like the most important lesson Tony Stark has learned in his whole life. As a result of Tony Stark’s final actions in Endgame, Peter received the mentor guidance he needed to save the Earth in NWH.
Even if Peter Parker never met the early, rougher version of Tony Stark, as a role model, Iron Man would have taught him about sacrifice and doing whatever it takes for the greater good. Iron Man had almost sacrificed himself to stop the MCU’s Battle of New York, was willing to die to prevent Thanos from enacting his plan in Infinity War, and had gladly subjugated his fellow Avengers to the Sokovia Accords in the service of the “greater picture.”
The MCU’s Iron Man may have been impulsive. Additionally, his personal life choices (before he let himself settle) were not the best examples for a teenager. However, he lived a life incredibly similar to Spider-Man’s most famous motto: “With great power comes great responsibility”.
Stark’s sacrifice at the end of Endgame was his revenge on Captain America for questioning his selflessness in The Avengers. Furthermore, it also served the greater purpose of encouraging Parker to undertake the most difficult thing he could.
Iron Man’s readiness to cast aside his family in Endgame to stop Thanos, or to lose his life the other times he’d willfully sought to sacrifice himself in the MCU, was a lot like Spider-Man’s decision in No Way Home to rip out his own heart. Peter’s decision to make the great sacrifice was a testament to how much Iron Man’s death meant to him. This, and that how much he had instilled in him his own ideals.