"Depending on what people mean by ninja, they may not have existed. "Shinobi warfare" ie. all the sneaky, underhanded parts of warfare is a real thing, but as I've commented before:
There is no doubt that "shinobi" warfare existed, it's documented from one end of Japan to another over centuries. And there is also no doubt that certain individuals were good at it and worked for their masters' benefit. Some of those individuals were indeed Iga and Koga people.
The key issue with the ninja tradition, though, is a) was there a particular Iga and/or Koga tradition of shinobi warfare, famed outside Iga and Koga? and b) did Iga and Koga warriors skilled in shinobi warfare ply their trade outside of their own territories and local wars?
I don't think there's actual existence for either of those things."
"Firstly, it is not only Kabuki theather where dressing in all black is a common way to represent ninja. Noh theater, which was widely appreciated by the samurai class during the Sengoku Period, also uses this technique to imply ninja and other hidden persons. And it's use in bunraku theater later was likely informed by its use in kabuki, which started in the early 17th century.
The performers that used this all black dress were usually called 黒子 kuroko. They usually wore all black but would also sometimes dress in colors that matched whatever the background was. Even when they didn't blend in, dressing in all black was supposed to indicate to the audience that, in the play, they were acting as though they were hidden.
There's almost no doubt that these depictions are what influence today's image of a ninja, because modern depictions of ninja draw from previous depictions in art.
For example, look at these ukiyo-e depictions of ninja dating from the early 1800s.
This one is by Utagawa Toyokuni, depicting a stylized ninja scene being performed by actors.
The earliest one I can find is the one by the very famous Hokusai, which one can see on the ninja wikipedia page. Hokusai is the ukiyo-e artist of Kanagawa wave fame.
Long before movies and anime of ninja were made, Japanese artists were already romanticizing, stylizing, and redrawing the idea of what a ninja was. And most artists were influenced by the theater, many works of art actually depicting specific actors playing as ninja, rather than depicting historical events.
As to whether or not ninja actually wore all black? Sometimes maybe, but it was not their main mode of dress, even for night time. Whether or not they sometimes wore black or not, the popular modern conception of a ninja is extremely disconnected with the historical ninja, and draws much more from Japanese theater than any historical accounts."
Additionally: https://www.ripleys.com/weird-news/debunking-the-image-of-the-ninja/
https://www.reddit.com/r/AskHistorians/comments/3q7yds/is_kabuki_theater_truly_the_origin_of_the_black/
https://ask.metafilter.com/82570/Did-ninjas-ever-actually-exist
https://kotaku.com/all-you-know-about-ninja-is-probably-wrong-5932403