Ninjas have a long history, coming from Japan. Today, they are part of television shows, toys, games, Halloween costumes, etc. Initially, they were overt agents or mercenaries who were experts in feudal Japanese warfare. They specialized in unconventional warfare, such as assassination and sabotage, during the age of the samurai. They often used surprise tactics. They used rumors and whispers about themselves to encourage fear among their enemies.
The Samurai were also part of Japan's history; they were hereditary military nobility from the late 12th century. These men were well-paid protectors of the great feudal landlords. They were held in high honor for over a thousand years. During the Edo Period (1603 - 1867), they made up the ruling military class. Their main weapon was the sword. As time evolved in the 19th century, the samurai became obsolete because of the expense of maintaining the troops. Instead, Japan used the average conscript soldier.
This is a good overview of the ninjas and samurai of Japan, how they came into being and what caused them to disappear.