Never explicitly stated but IMO Kaguya's Truth-Seeking Balls given sentient life. We know she uses them but we never see them other than the giant one in one of her Dimension.
Think Father from FMA and the way he split off parts of his personality to give other homonculus life. Kaguya as we know her was just a husk whilst BZ was her mind and legacy, in the form of her biggest complex- a child who does as he's told.
TSB on it's on could be sturdy and could be liquid as BZ was shown to be. Though what makes me think this is that a part of BZ dissapeared as Obito created the black staff.
He is the living demon spirit of the tree that came into Kaguya's body when she ate the fruit.
He is smarter than Kaguya, he is the one who controls her actions and not the contrary, that's why I don't think he is Kaguya's spirit.