my mohg, miquella, and the haligtree timeline in loose bulletpoint format:
• Time: who knows, some point a little before the shattering. Mohg escaped the sewers and is assembling his dynasty, pureblood knight era and ansbach is much younger.
• Shortly after that: encounters Miquella. They have completely incompatible ideas of how things Should Be (Miquella wants to end all suffering, Mohg wants to worship his suffering). Miq tries to "fix" Mohg's pain with his charm. This is a surprise tool that will help (hurt) us later (and this is also when Ansbach fails to save Mohg)
• Miquella goes full speed ahead on his Haligtree plan. The Erdtree is unwilling to take in the graceless, but Miquella is still trying to find a way to Fix Everything without becoming exactly like his mom. So he invents Erdtree 2.
• Miquella realizes that the Haligtree is doomed. Failing every single attempt to save the world leading up to this, he accepts his fate and begins his journey to become a god, and sends Malenia to Radahn to make him fulfill their promise (one way or another)
• Mohg, completely taken by the charm, the Formless Mother, and the corruption of his Great Rune, becomes fully obsessed with Miquella, and believes him to be a solution to his ambitions of Lordship. While Miquella is asleep in the cocoon, and while Malenia is in Caelid, he sneaks into the Haligtree and steals Miq away, with the intent of using his Empyrean body for the Formless Mother (not unlike how Radahn is ascended with Mohg's remains)
• Game timeline: we arrive, we go to kill Mohg
• Game timeline (middle of SoTE): Miquella's soul, currently in the Realm of Shadow, learns of Mohg's defeat. In Castle Ensis, he also learns that a soul can be brought back with another's remains. Having completely abandoned his love and doubts and anything that could tell him this is a bad idea at this point, he goes through with using Mohg's body for the last thing he remembers of himself (his promise to Radahn).
This also, in an ironic twist of fate, also fulfills Mohg's desire to become his consort as well (in body if not in spirit)