So from what I read, the God Tree landed on Earth from a meteorite several millennia ago. Basically landed before man kind. It also said that people were praising it like a sacred pillar from the gods but in reality it was slowly killing the earth by draining the natural chakra in the soil, rocks, water, and air. It also said that every thousand years, the God Tree produced a 'Chakra Fruit' which humans were suppose to stay away from. Members of the Otsutsuki clan searched through dimensions in search of the God Tree so they could eat the chakra fruit and obtain powerful chakra for themselves. It also said that once Kaguya Otsutsuki ate the God Tree's chakra fruit, she enslaved part of the humans population with the Infinite Tsukuyomi and bound those affected by the God Tree with it's life transforming them into White Zetsu. When Kaguya had her two sons, Hagoromo and Hamura, they were born with their own chakra, so she merged herself with the God Tree to take back their chakra and becoming the Ten-Tails itself.
I gathered this information from