Toshiro Mifune portrays a Samurai who finds himself in the middle of a feud-torn Japanese village. Neither side is particularly honorable, but Mifune is hungry and impoverished, so he agrees to work as bodyguard (or Yojimbo) for a silk merchant (Kamatari Fujiwara) against a sake merchant (Takashi Shimura).
He then pretends to go to work for the other, the better to let the enemies tear each other apart. Imprisoned for his treachery, he escapes just in time to watch the two warring sides wipe each other out. This was his plan all along, and now that peace has been restored, he leaves the village for further exploits.
Yes, Yojimbo was the prototype for the Clint Eastwood Man with No Name picture A Fistful of Dollars (1964). The difference is that Fistful relies on Eastwood for its success, whereas Yojimbo scores on every creative level, from director Akira Kurosawa to cinematographer Kazuo Miyagawa to Mifune's classic lead performance.