How did unity go from mobile game development darling to being acquired by an adware company?
Fortnite.
The unimaginable runaway success of Fortnite took Epic from "market entrant" status to "dominant industry leader". It allowed them to pour hundreds of millions of dollars into Unreal development, and enabled them to finally release the engine under a freemium model to indie devs. That, (combined with the iOS ad-pocalypse) has led Unity to a long slow decline in developer share ever since.