Board Thread:Naruto Discussions/@comment-34661853-20181122024542/@comment-1872728-20181122033556

I think the most correct version, in my opinion, would be:

Hagoromo and Hamura sealed Ten-Tails (Kaguya and God Tree), creating the moon. Hagoromo then learned that teamwork is the way to go from Asura, so he summoned Ten-Tails back from the moon, then sealed it in himself so he can split the Ten-Tails' chakra into 9 pieces, creating the 9 Tailed Beasts. Now he's left with the Statue of the Outer Path inside of him, which he then sent it back to the moon before he died.