A ronin was a masterless samurai who had lost his privileged status in society. The tale of the 47 Ronin has become one of the central myths in Japanese history. It concerns a supposedly real-life story from the beginning of the 18th century when 47 samurai were left without a master and therefore became ronin when their leader, feeling unjustly treated, drew his sword against his lord and was, as a result, forced to commit seppuku, or ritual suicide.
His domain was confiscated. The ronin plotted to take revenge on the lord who had wronged their master. Knowing that they would be watched by the authorities, they bided their time for two years, pretending to live a life of dissipation. Then on a snowy winter night they assembled in Edo, broke into the castle of the offending lord, and took his head.
The Tokugawa Bakuhan allowed the 47 Ronin to commit seppuku, thus ending their lives with honor. The story has been retold in print, theater, puppetry, and film many times in subsequent years. The notions of honorable sacrifice and justified vengeance-taking have become deeply embedded in the Japanese psyche.
This event is important in reinforcing the class-based structure of Japanese society at the time: Samurai were bound by the Bushido, the Way of the Warrior, to which lesser people could only aspire.
Even though the 47 spent the time between the original offense and the time of vengeance hiding, disguising themselves, and spying on their enemy in a variety of ways that may be considered underhanded, this is not considered to be in any way dishonorable, and the final result negates the means by which it is completed.