From Mie University, International Ninja Research Center.
In history, ninja were called shinobi. Their most important job was to gather information when their lord ordered them to.
They are thought to have come from armed groups called akuto, which grew stronger from the end of the Kamakura period. They were active from the Nanbokucho period in the early 14th century to the end of the Edo period in the late 19th century.
In Iga, the daimyo were weak, so the people ran their own affairs, and ninja skills for defending themselves grew there.
In the Sengoku period, daimyo in many places hired shinobi. They broke into enemy land, set fires, destroyed things, attacked at night and set ambushes.
But the most important thing was to tell their lord about the enemy. So they avoided fighting as much as they could, and had to come back alive.
In the Edo period, there were no more wars. Ninja became low-ranking samurai serving the shogunate or a domain, farmers with samurai rank, or ordinary farmers.
Some families wrote ninjutsu books so the skills would not be forgotten. These books cover the right mindset, sneaking in, disguise, making friends, talking, memory, sending messages, magic and fighting, and also medicine, food, stars, weather and gunpowder.
There is no single right answer. Talking it over with someone at home is a good way to learn.