The sheer genius behind Doctor Strange’s long game.
As you will recall in Infinity War, Strange was strict about not giving up the Time Stone to Thanos at any cost.
However, when Tony’s life hangs in the balance, Strange relinquishes the Stone to Thanos in exchange for sparing Tony.
Now, keep in mind that the Master of the Mystic Arts previously stated that the now-iconic one out of 14,000,605 different ways was the only chance that the Avengers had to win.
So many of the hypothetical outcomes have been debated to death (don’t bring the TVA into this, Ravonna stated the Time Heist was part of the Sacred Timeline), but we’d like to focus on how assured Strange’s plan was once he put it into action.
To understand that, take a look at the scene in Endgame where Bruce talks to the Ancient One in 2012 about temporarily giving him the Time Stone.
THE ANCIENT ONE (2012): I can’t risk this reality on a promise. It is the duty of the Sorcerer Supreme to protect the Time Stone.
BRUCE BANNER: Then, why the hell did Strange give it away?
THE ANCIENT ONE (2012): [Surprised] What did you say?
BRUCE BANNER: Strange, he gave it away. He gave it to Thanos.
THE ANCIENT ONE (2012): Willingly?
BRUCE BANNER: Yes!
THE ANCIENT ONE (2012): Why?
BRUCE BANNER: I have no idea. Maybe he made a mistake.
THE ANCIENT ONE (2012): Or I did.
After that exchange, Bruce’s Astral Projection is returned to Hulk and she gives him the Time Stone.
The Ancient One said to Strange in his first film that she cannot see past her death. She knows of every single future event up to that point (including Bruce’s anachronistic presence), but beyond her death? Nada.
Back to Strange’s plan.
The one outcome that Strange saw that the Avengers win? That assuredly required Tony to be alive so he could create the Time GPS to get them through the Quantum Realm (Ant-Man’s involvement notwithstanding).
Had he given the Stone away sooner or later than that, Thanos might have killed everyone there, suspecting some sort of trap or planned countermeasure, so Strange chose the one, single moment that could guarantee Tony’s survival.
If Strange didn’t give the Stone to Thanos under the exact conditions that he did (when Tony’s life was at stake), then Thanos would’ve just beaten it out of him. Then, when the Time Heist was executed, Bruce wouldn’t be able to convince the Ancient One because she would assume that Strange was simply trying his best to protect the Stone and failing; she would presume he didn’t have any idea whether they would win in the end or not.
By giving the Stone to Thanos of his own accord, The Ancient One would understand that Strange saw the one way they would win when Bruce told her that Strange gave the Stone willingly – because it tells the Ancient One that Strange not only surrendered it with a purpose behind it, but was confident enough in his strategy – and hence would give the Stone to Bruce to fulfill Strange’s timeline.
A coded message sent through time and death ensured the Avenger’s victory.