What exactly is the "Ritual of The Divine Tree"? In the anime, it is shown that Kaguya regularly sends people to the Divine Tree for this "ritual" and those people somehow die.

So what exactly happens to them? I thought the Infinite Tsukuyomi was supposed to make people dream in their ideal world... Then how do people who go there for the ritual end up dead, whereas the ones who were first caught in it (King Tenji and others) live in their ideal worlds?
They live in their ideal worlds but while that's happening the tree is turning them into white Zetsus and I think somewhere in that process their brains turn to mush killing them. Thats where they got the army of Zetsus in the first place (by sacrificing people with the ritual turning them into Zetsus).