After the blast, Sasuke and Naruto got pushed back, this gave time for Kaguya to freaking teleport in an awesome way right to them and hold them. At this point, Black Zetsu appears to absorb their chakra. He then explains the past. The juubi was in essence Kaguya's will, and by Hagoroma and Hamura sealing it, so was Kaguya (that part I'm still unclear) Before this though, Black Zetsu was spawned out and he tried to force the transmigrants of Indra or Ashura to unlock the rinnegan in order to bring Kaguya back to life. One way he did this was changing the content in the Six Paths Stone Tablet. Eventually it happens, Black Zetsu helped Madara "survive" against Hashirama. Madara uses the Mangekyou's ability to use jutsu after a span of time (like a camera taking a photo after setting a timer) to use Izanagi and change his death. He takes the "meat" from Hashirama, puts it within himself, unlocks Madara. Story is now current. Then, Naruto begins to TNJ Kaguya