Who Were the Ninja?:
Ninja leaders, or jonin, were often disgraced Samurai like Daisuke Togakure, who lost all his lands and status as a Samurai in battle. Some had been denounced by their daimyo, but ran away rather than committing seppuku. Seppuku is a form of Japanese ritual suicide by disembowelment, and was originally reserved exclusively for Samurai.
However, the majority of Ninja were not from the nobility. Instead, they were farmers or villagers who learned to fight by any means at hand, as a matter of self-preservation.
Not all Ninjas were men. Women also served as Ninjas, and infiltrated enemy strongholds disguised as dancers, concubines or servants. They were extremely successful spies, and very often assassins, too.
Samurai Use of the Ninja:
As the proud Samurai were bound to uphold their code of honor, or bushido, it was sometimes quite challenging for them to prevail in open battle or warfare. So, Samurai sometimes hired the more sneaky Ninjas to do their dirty work for them.
Ninjas could ferret out secrets, spy with impunity, plant seeds of misinformation within enemy ranks, carry out furtive assassinations, etc. By employing Ninjas to do things outside the Samurai code of ethics, it was possible to achieve their means without besmirching the Samurai honor.
Bear in mind that this could be a double edge sword, because one samurai might hire a Ninja to annihilate another Samurai with whom he had some difference that couldn’t be honorably and/or openly settled. Therefore, Ninjas were hated and feared in equal measure by the Samurai.
There was a certain pecking order within the hierarchy of Ninjas. The Ninja high man, or jonin, gave orders to the Middle man, or chunin, who then passed them down to the genin, or ordinary Ninja.