Kai is an old name for Yamanashi prefecture. In the 16th century, there was a famous samurai whose name is Takeda Shinge. Shingen repeated battles agains Uesugi Kenshin who came from Echigo, currently Niigata prefecture. Kenshin was also famous samurai those days. They had fought at Zenkoji-daira, a basin in the northern part of Nagano prefecture which is next to Yamanashi.
Shingen feared losing the Zenkoji temple, located in Zenkoji-daira, by fires of battles, and moved all the things of the Zenkoji from Nagano to Itagaki in Yamanashi. Things moved to Yamanashi include the idol, some statues and treasures of the Nagano Zenkoji. Itagaki is a place where Honda Yoshimitsu, the founder of the Zenkoji temple, waas buried. In 1565, SHingen buiilt a main hall of the Kai Zenkoji Temple there with all those things he took from Nagano Zenkoji Temple.
In the 17th century, Tokugawa Ieyasu unified and ruled Japan. He was very eager in Buddhism, and designated the Kai Zenkoji Temple as a temple in which the Buddhist memorial tablets of the Tokugawa family are stored. For that reason, the Kai Zenkoji was the backbone of big temples in Yamanashi then.
However, the temple completely burnt to ashes in 1754. The present construction you can see was reconstructed in 1796. It cook for 31 years for the reconstruction. The main hall and outer gate are the important cultural assets of Japan. They are known as wooden architecture of the Yedo era.