The most common theory about the origin of ninja is that they were originally Shugendō trainees who practiced in mountainous areas. Togakushi also has Togakushi-ryū Ninpo, one of the main schools of ninja arts, which has been passed down through generations. At the Togakushi Ninja Museum, one can see the origins and tools of ninja arts.
Some say that ninja arts developed in Togakushi because it was protected by the Tokugawa family of the Edo Shogunate. To the south of Togakushi was the Matsushiro Clan, ruled by the Sanada family. Even in the peaceful Edo period, the Tokugawa Shogun, having suffered many times at the hands of the Sanada family in past battles, was concerned for his life. So he commissioned the ninjas of Togakushi to spy on the Sanada family, due to their relative distance from Matsushiro Castle, where the Sanada clan head resided.
In addition, to the east of Togakushi, there is Hokkoku Highway. The Shogunate must have kept their watchful eye on this road, as it was used by the Maeda clan of the Kaga domain, the second most powerful clan to the Tokugawa clan, when they moved between Edo and in their family lands. The road was also used for carrying gold from the Sado Kinzan gold mine. All of these factors were why the ninja of Togakushi were fairly active.