Thanos learns of the battle in Xandar and retreats back to his home world. He sent the Black order to gather rare resources from some of the worlds he have conquered and sent the rest of his army to recruit soldiers from all the planets he have already attacked.
Doctor Strange views the future and informs everyone that if Thanos is given time, he will be able to create powerful weapons that will enable him to fight equally to anyone with an infinity stone. Because of Thanos style of fighting which is either giving the order or fighting himself, people have forgotten that he is cursed with knowledge. Doctor Strange said that if they give Thanos even one year, then not only can he upgrade his weaponry but his army's size would increase several times.
The X-men, masters of the mystic arts, Iron Man and his army as well as the armada of ships belonging to earths defense force all set out to attack Thanos in his home planet. An epic battle happens wherein the death toll increased to thousands per second as the super powers of earth didn't let up and used 100% of their strength.
The Black Order sacrificed their lives to let Thanos escape. As long as Thanos escapes, his loyal followers spread all over the universe would have a chance to gather and avenge the humiliation the Black Order suffered in this war.
While Thanos flies in a specially designed ship, a floating mass of energy moves in and swipes Thanos out of existence. The energy scans every living creature in this planet and locates the wizard.
"You unfilial disciple of mine. Come here and apologize to your master. Didn't you know how much I had to suffer because you used the forbidden book and stole the golden dragon hearts." The wizard's master may be rattling off lots of complaints to his disciple but he never stopped smiling. He was not able to hide how happy he was in finding his disciple.
Koro learned from his master that the dimension he is staying in right now is a fanfiction world that would repeat endlessly with various slight alterations. But the total time that this world revolves around is three hundred years. It Starts in wolverine's birth in the 1800 and ends in the early 2020's. He can choose to become a god through faith-based process but he will become part of this unending cycle. As an apprentice wizard, his memories would not be erased in any loop.
Or he can cleanse his soul that is stained by the fanfiction dimension through missions. He needs to visit various fanfiction worlds and destroy any trace of other writers and keep MCU pure. After cleaning out five such fanfiction dimensions, he can return to his master's world and become a true wizard.