What roused the Iga vs Koga (伊賀忍軍対甲賀忍軍; Iga Ninja Army vs Koga Ninja Army) rivalry in various fiction?
In Edo Period, storytelling features Iga and Koga as rivals due to their activity in the Tenshō Iga no Ran. While Iga and Koga aided Ieyasu's escape to Mikawa after Nobunaga Oda's death, there is an incident that the Koga were employed under Hideyoshi Toyotomi. Tokugawa and Totoyomi seemed to have had a proxy war, since the latter's primary hostilities was Akechi Mitsuhide and Oda Nobukatsu (Nobuo). Tokugawa primarily stayed on the defensive at Owari. The Koga were ordered to spy on Ieyasu Tokugawa; as the consequence, and considering the dangers of compromise, the Iga Ninja were assigned the mission to hunt down Koka Ninja.
Another possible reason was the alliance between the Oda and the Tokugawa, who fought in Omi Province.
Much like the fictional depictions, further rooted. May trace back to Northern - South Court era.
- YAHOO Q&A:伊賀忍者と甲賀忍者の違いを教えてくだされ。 (Japanese)