A ninja (Japanese: 忍者, lit. 'one who is invisible'; [ɲiꜜɲdʑa]) or shinobi (Japanese: 忍び, lit. 'one who sneaks'; [ɕinobi]) was an infiltration agent, mercenary, or guerrilla warfare and later bodyguard expert in feudal Japan. They were often employed in siege, espionage missions, and military deception. They often appear in the historical record during the Sengoku period, although antecedents may have existed as early as the 12th century.
During the Japan's warring state period, jizamurai clans of peasant-warriors in Iga Province and the adjacent Kōka District formed ikki – "revolts" or "leagues" – as a means of self-defense.
Following the Tokugawa shogunate in the 17th century, the ninja faded into obscurity. A number of shinobi manuals, often based on Chinese military philosophy, were written in the 17th and 18th centuries, most notably the Bansenshūkai (1676).
Ninja is the on'yomi (Early Middle Chinese–influenced) the two kanji "忍者". In the native kun'yomi reading, it is pronounced shinobi, a shortened form of shinobi-no-mono (忍びの者). The word shinobi appears in the written record as far back as the late 8th century in poems in the Man'yōshū. The underlying connotation of shinobi (忍) means "to steal away; to hide" and—by extension—"to forbear", hence its association with stealth and invisibility. Mono (者) means "a person". The word ninja was uncommon, and a variety of regional colloquialisms evolved to describe what would later be dubbed ninja. The first known English use of the word ninja was in 1964. Kunoichi (くノ一) is, originally, an argot which means "woman";: p168 it supposedly comes from the characters くノ一 (respectively hiragana ku, katakana no and kanji ichi), which make up the form of kanji for "woman" (女).: p168 In fiction written in the modern era kunoichi means "female ninja".: p167
By the time of the Meiji Restoration in 1868, shinobi had become a topic of popular culture in Japan which featured in many legend and folklore, where they were associated with many supernatural abilities.
Source : Wikipedia