In the later 14th Century Ce, Japan was fractured and falling apart socially. Shoguns and daimyos, warring for dominance, all had their personal assassins, trained in esoteric but mortal methods of discreet warfare. This fragmentation had also broken the power of the Shinto pantheon, as worshippers started to drift more and more apart and the gods bickered over increasingly weaker domains.
The Dutch arrived in 1640. The introduction of trade and other religious beliefs starts to weaken the Shinto pantheon even more. Moreover, particularly potent entities of significant temporal power on Earth arrived in Japan and offered Faustian bargains for power, furthur corrupting Japan's leaderships.
The gods of Shinto sought to arm their people against these hostile ideologies and new magic. Many of them retained senshi or Buddhist sohei, devoted warriors and guardians. They empowered certain faithful with remarkable, rare magical talents, training their select few in remote and inaccessible locations. Methods and results were very idiosyncratic; every god has their own school of magic, combat, and tactics.
Those members of the Kami who recruited ninjas dubbed their guardians as 'Shinobi'. These ninjas developed uniquely useful magical talents as well as refining esoteric physical skills.
Among all Kami, the most worthy Shinobi was selected to represent the entire pantheon's interests. These ascendants are Divine Shinobi, literal divine emissaries of the entire Shinto pantheon and essentially demigods in their own right.
The first schools were founded near Koga. As the appeal of the ninja clans grew in the eyes of the Shinto, temple-schools were erected across Japan. Some overlapped with Buddhist monasteries and ancient shamanistic traditions, integrating the esoteries of ritual magic with their religious customs and worship. Much tension exists between the gods of the schools, though their followers tend to find more reasons to cooperate than distrust one another.
Around 1730, an ambitious young Shinobi candidate was passed over for appointment to role of Divine Shinobi. Humiliated and angry, he called out in the darkness for vengeance. The darkness answered back in the form of an ancient demonic entity: The Beast.
In exchange for giving the Beast all the secret knowledge of the Shinobi, he was empowered by The Beast with dark and terrible magics. He became the Dark Shinobi, and started a secret guild of magically-trained assassins which was eventually called The Hand. Murderers, poisoners, provocateurs and sabotagers, they would sell their talents to anyone with the coin-- or donate their assistance to anyone who advanced their causes. He personally led a campaign to assassinate every ninja, sohei, and senshi he could. He travelled across Japan, sometimes dueling other Shinobi in honorable combat, and other times assassinating the population of the school and stealing their ancient texts and techniques for himself.
Though the rogue Shinobi was eventually defeated by the new Divine Shinobi, his legacy persisted in the form of splintered new groups from the ninja clans. Two of these offshoots became known as The Hand and The Foot clans.