First of all Shinobi were not the same throughout Japan’s history. Same thing with Samurai, who at one point literally comprised 1/10th of the entire population of Japan at one point. That’s how common and low class Samurai could become at one point.
Same thing with Shinobi. Even reading that article, you realize that there is a battle going on. Between the westernized pop culture version, of what later Japanese depicted of the historical Shinobi (which historical documents from the period contradict the post-shinobi depictions of the Japanese) and between the actual historical Shinobi, which were just warriors trained in espionage.
Ninjas as you know them are not as they seem, Wikipedia is where I get my source of that from. Just read through it. While yes, a lot of stereotypical elements of Ninja exist, like examples of the black outfits, the cool weapons, and romanticized “badass clans in the mountains”, it was never like that from the documentation. Those depictions came from later on in Japanese history, and romanticized stories of assassins.
In fact, Ninjas historically have little records of assassinations. They were doing espionage, not assassinations.
Here is even a part where they’re basically saying Samurai became Ninja with even mentioning only once though:
It was not until the 15th century that spies were specially trained for their purpose.[14] It was around this time that the word shinobi appeared to define and clearly identify ninja as a secretive group of agents. Evidence for this can be seen in historical documents, which began to refer to stealthy soldiers as shinobi during the Sengoku period.[22] Later manuals regarding espionage are often grounded in Chinese military strategy, quoting works such as The Art of War by Sun Tzu.[23]
The ninja emerged as mercenaries in the 15th century, where they were recruited as spies, raiders, arsonists and even terrorists. Amongst the samurai, a sense of ritual and decorum was observed, where one was expected to fight or duel openly. Combined with the unrest of the Sengoku period, these factors created a demand for men willing to commit deeds considered disreputable for conventional warriors.[19][2] By the Sengoku period, the shinobi had several roles, including spy (kanchō), scout (teisatsu), surprise attacker (kishu), and agitator (konran).[22] The ninja families were organized into larger guilds, each with their own territories.[24] A system of rank existed. A jōnin (“upper person”) was the highest rank, representing the group and hiring out mercenaries. This is followed by the chūnin (“middle person”), assistants to the jōnin. At the bottom was the genin (“lower person”), field agents drawn from the lower class and assigned to carry out actual missions.[25]
Here is a better source, and they also cite sources for actual historical documentation you can buy and read yourself.