The Sengoku Jidai
All the action in the Tales of the Ninja Coder takes place during a period of Japan's history known as the Sengoku Jidai. This is usually translated into English as "Warring States Period" (jidai means "period"). Warring "States" may be a bit of misnomer, because the things that were warring were more like individual daimyō and their lands. Something like "the period of random warlords in an ongoing, chaotic fracas" might be a little more accurate… but it lacks a certain je ne sais quoi.
The Sengoku Jidai was preceded by the Muromachi Jidai (also known as the Ashikaga Jidai, or the Ashikaga shogunate — basically, the Ashikaga clan controlled the shogunal government, from their headquarters in the Muromachi neighborhood of Heian-kyō). Regardless of what you call it, that period was one in which the shogun started off fairly weak, and soon became a mere puppet. When the Yamana and Hosokawa clans quarreled over who would get to control that puppet, their quarrel grew into the Onin War (starting in 1467), which quickly engulfed all of the capital city of Heian-kyō (now called Kyoto). After ten years, the chaos expanded beyond the borders of Heian-kyō and consumed the entire country; all semblance of centralized authority or government broke down completely, and Japan was plunged into over a century of anarchy.
In American terms, a reasonable parallel can be made with the Old West: in both countries, we're looking at a period of lawless chaos, a time that may look very romantic and heroic in retrospect (from the comfortable remove of more than a century…), but which at the time was probably both inconvenient and terrifying for those who had to live through it. Samurai and rōnin wandered the countryside, much like gunslingers: a law unto themselves.
During the Sengoku, the government wasn't the only thing that broke down. The rigidity of the Japanese caste society also broke down, allowing a variety of non-nobles to rise into the ranks of power through force of arms and skill. This example of meritocracy was called gekokujō, meaning "the underling conquers the master" (which may say something about feudal attitudes toward meritocracy). Individuals like Oda Nobunaga and entire clans like the Hōjō clan, previously a bunch of nobodies, rose to control entire provinces and become major players on the national field.
At the same time, groups of farmers, peasants, and monks banded together in groups that came to be called Ikkō-Ikki (meaning "one mind, one group" or "single-minded league"). These were basically uprisings of rabble that would overthrow the samurai and nobles of a given region, and then rule the place as commoners — something like the American revolutionaries' decision to abolish any system of nobility in their new country, except that the Ikkō-Ikki were all eventually put down.
Eventually. In some places, it took very nearly until the end of the Sengoku, around 1600.
Naturally, any period of such intense chaos had to come to an end: everyone involved wanted it to end, either for their own safety or because they wanted to control Japan. First, Oda Nobunaga launched his unification drive, starting in Mikawa Province in 1568. By 1582, he had conquered large swathes of Japan, and looked unstoppable, but he was betrayed by one of his own generals. After that, his follower Toyotomi Hideyoshi carried on Oda's work, and managed to become the effective ruler of the country, with his son set to inherit his power and become shogun. Unfortunately, Toyotomi died in 1598, before his son was old enough to rule, and the council of five regents that Toyotomi appointed broke down in infighting and mutual betrayals. Eventually Tokugawa emerged the victor from this chaos, and finally consolidated his hold on the country in 1603. This is considered the final end of the Sengoku Jidai, and the start of the Edo Jidai. (Named for the city of Edo, which Tokugawa made his seat of power and the new capital. Edo is now known as Tokyo.)
The period from 1568 to 1603 is called the Azuchi-Momoyama Jidai, after Oda's castle of Azuchi and Toyotomi's castle of Momoyama. The Azuchi-Momoyama Jidai is considered by many to be the final phase of the Sengoku Jidai; others consider it an independent jidai of its own.
The Tales of the Ninja Coder are set (roughly speaking) in the 1570s. Oda had already conquered and unified his home province of Mikawa, but the rest of the country (including Iga, Kōga, Ōmi and the lands around the capital) were still in chaos. It was a dangerous time, with no central authority to protect anyone from anyone else. Aside from the various major daimyō trying to conquer large regions, there were still a great many smaller warlords trying to become (or remain) major powers, and nothing to stop them from forcibly recruiting anyone they could lay their hands on if they needed warm bodies. Aside from that, random bandits, mercenaries, and rōnin wandered the countryside, making their living however they could.
It's little wonder that this was also the period that saw the beginnings of the machi-yakko, or "servants of the town" — essentially, the start of city guard units as somewhat-organized entities. (These later evolved into the police forces of the Edo Period, and some Yakuza groups claim descent from them as well.)
Finally, the Sengoku Jidai was a prime time for ninja to sell their services to the highest bidder: whoever had the best spies and assassins working for him could easily parlay their skills into an advantage on the battlefield.