Tony Stark has an artificial intelligence somewhere that has been running behind the statistics of crime. If the crime statistics are high, Tony Stark could know there are is a need for superheroes, and that is the reason Tony Stark built Ultron. So Tony Stark who has artificial intelligence observed all the superheroes. When he wanted some superhero to support him during the fight with Captain America help him fight with Steve Rogers. Tony Stark is emotionally attached to Peter Parker. Tony Stark generally doesn’t trust anybody but he trusted Spiderman.
In the MCU Tony Stark always take care of spider man as a soon as he wanted Peter Parker to transform into a better superhero than himself. Peter Parker is a teenager who was always been dependent and Tony tried hard to bring out the independence from him which gave Peter Parker self-confidence and perspective. Peter Parker also respects Tony. He views Tony Stark as his father. Peter is intimidated by Tony but not scared of him. He always wanted to be to the side of Tony and considers him as an idol. Peter Parker wanted to become as great as Tony Stark and save the entire universe and moreover he always wanted to work with Tony Stark.
Tony always took care of Spiderman, and he considered Peter under his wing from the beginning. He always wanted to make Spiderman powerful and mentored him with all the required abilities. When Thanos snapped out half of the universes out from existence Peter Parker is alongside Tony Stark on Titan. Peter Parker was also snapped out during that along with the remaining people. Tony always wanted and insisted Peter Parker be a better hero and in turn, Peter Parker wanted Tony Stark to be a father-like figure.
Tony Stark and Peter Parker were emotionally attached and the death of Peter Parker on the Titan has a huge impact on Tony Stark. Though Tony Stark wasn’t responsible for it, he had the guilt for five years, and he completely became a grounded person after he quit Avengers. This made Tony Stark a better father to Morgan. After The Avengers Infinity War Tony Stark took a five-year gap before being reunited with Avengers again. During those five years, Tony Stark made EDITH which could hack any nearby computerized device and was security properties along with tactical intelligence. It could easily access Stark Industries. It is based on Artificial intelligence. It could control drones and it is third artificial intelligence technology created by Tony Stark after JARVIS and FRIDAY. EDITH means Even Dead I’m The Hero.
Iron Man posthumously handed over Edith to spider man as he believed that Spiderman would use it in a “responsible” way. Tony believed that Avengers could get back the population that has been snapped out of the universe by Thanos if their plan was successful. He never expected to fight with Thanos nor anyone as they plan to only get back the stones and bring back the population. They were never prepared for the fight so didn’t carry Edith along with him. He left it for Peter Parker who would be returned if their plan worked. Tony and the remaining superheroes were unaware of Thanos until he strikes them.
Their plan doesn’t involve fighting Thanos, because he’s dead. It doesn’t require E.D.I.T.H. because Thanos is dead. But past Thanos becomes aware of the time travellers and attacks them in the future. Avengers never knew that Thanos is going to strike them, and by the time he strikes, it’s too late for Tony to use E.D.I.T.H. He wasn’t expecting to fight anyone. After The Avengers returned collecting all the time stones, they were followed by Thanos and his army, giving Tony no time to get his hands-on EDITH even if he wished to. Iron Man didn’t have EDITH on him, which is made obvious by the fact that he wasn’t wearing the glasses because, at this point, he had already made arrangements for Peter to get it. Peter would have been dead when Stark decided to leave it for him, but he believed that if their plan was successful, they would be able to restore the people, Thanos killed, so, he did not carry nor able to use the powerful EDITH during the fight between The Avengers and Thanos which ultimately lead to the death of Tony Stark.