Tony Stark programs his suit to act fully autonomously in the event he’s ever knocked unconscious or otherwise incapacitated. In addition to fighting villains and saving people, it’s programmed to seek out a power source so it can replenish itself.
Except he dies inside the suit, which continues carrying out all its advanced programs without him. And it cannot be shut down, especially because it will defend itself against anyone who tries to tamper with it. Even Tony’s friends and allies can’t take it offline.
So essentially you’ve got Tony’s metal-encased corpse rocketing around committing various heroic deeds, indefinitely. People are grateful to be helped but really freaked out at the same time. And poor Pepper.
By Julito82 – Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=4844819