Feudalism is a form of government used in medieval Japan. Feudalism is where every social rank is dependent upon one another It makes it so that each class is important and needs the others to be successful. Society without feudalism would probably very unsuccessful and chaotic.
The samurai code (Bushido) is how the samurai swore to act towards the people who could not protect themselves. The code of Bushido like the code of Chivalry in Europe governed a samurais life. A samurai's supreme duty was to be so loyal to his lord he would gladly die for him. This made sure the samurai were completely loyal and had no second thoughts about who they were protecting. Without the samurai the Japanese wouldn't have any protection.
A Shogun is a military leader. Shogun appointed daimyos samurai. Shoguns were also at the top of the social pyramid. Shoguns had the most power in feudal Japan and made sure each daimyo and everyone was protected by their samurai. Without shoguns the daimyos would probably end up fighting each other.