Board Thread:Theories and Speculation/@comment-25139119-20150930151135/@comment-4912646-20151001073548

The balls have multiple origins. Kaguya got them (or at least their enhanced form) from eating the chakra fruit, Hagoromo and Hamura were apparently born with the ability to make them, and Toneri got them while in Tenseigan Chakra Mode. The fact that Obito and Madara had ten balls while Naruto had only nine is suspicious, seemingly implying some relation to the tailed beasts they had. Plus the databook described them as being similar to Tailed Beast Balls, take from that what you will.