Most ninja assassins were hired by rival daimyo to kill their opponent, without much success. It is this element of ninja skill which has been most over emphasized in our modern understanding of ninja warriors. In many, but not all, of these accounts the ninjas in question originated from Iga or Koga province, now modern day Mie Province. This is considered the ancestral homeland of the ninja arts, and it does indeed seem to be the main area of ninja activity. Oda Nobunaga finally decided they were too dangerous and crushed Iga in a punitive expedition in 1581.
Legend has it that surviving ninja dispersed to all parts of Japan after their defeat.
Wherever they went, their usefulness was soon at an end. But where Oda Nobunaga looked at the ninja and only saw a threat, Tokugawa Ieyasu saw an opportunity, and soon he had a group of Koga ninja in his employ. They participated in the battle of Sekigahara, though without particularly distinguishing themselves. They worked for Tokugawa again in 1614-15, during the campaigns against the last Toyotomi heir, and one last time in 1638 against the Christian daimyo of Kyushu in the Shimabara Rebellion, in both cases operating in their traditional role as masters of seige warfare. After the Shimabara Rebellion, there was peace at last.