Early Shinto showed a marked shift from animism to ancestral deities, according to Mori Mizue in ‘Ancient and Classical Japan: The Dawn of Shinto’ (in Shinto – A Short History, 1998).
The background concerns the eighth century, following the celebration of a sacral emperor in the mythologies of Kojiki (710) and the subsequent organising of shrines under a central authority. In 768, an ambitious monk named Dōkyō made an audacious attempt to become emperor. As a result the establishment sought to strengthen the hereditary principle and the right to rule by blood lineage. Many of the shrines originating in the late eighth and ninth century were consequently typified by family groupings and putative ancestral clan founders, shrines such as Kamo Jinja and Hie. It was around this time too that Hachiman came to be identified as former Emperor Ojin.
The old kami were territorial, but these new kami were based on ties of blood. Mori Mizue suggests the eighth-century verse anthology Manyoshu might have been compiled towards a similar end, in order to venerate the blood ties of the ruling class. At the end of the century, under Emperor Kammu (who founded Heian-kyo), major shrines came to be seen as places to celebrate the ancestral spirits of those in authority, and by the time of the Engishiki (927) few of the old nature spirits are listed amongst the kami.
Kami started as nameless and formless spirits. Personification followed, influenced by Buddhism. Then came the transformation into ancestral spirits. In such manner the spirit of the sun became Amaterasu, the weaver-queen.