It's about Bushido, "The Way of the Warrior." This was the samurai's code. Their tenet. Their way. And this strong belief system coupled with an amazing set of fighting skills is what causes many to hold them in reverence even today.
Starting From the Beginning: The History of the Samurai
Good coaches don't stand pat when their team gets destroyed in a game; they make changes. Such was the case with the Japanese following a rather disastrous war with Tang China and Silla. In 646 A.D. by way of the Taka Reform, Prince Naka no Oe (Emperor Tenji) introduced Japanese society to aristocracy via higher taxes that left some wanting and some basking in riches as landowners. Later, the Taiho Code (702 A.D.) introduced the military draft, which helped Japan to grow an organized army, similar to the Chinese that had given them so many problems earlier in their history. The Taiho Code also classified imperial bureaucrats into 12 ranks. Initially, the term samurai was used to refer to those of 6th rank or below (public servants). As farmers continued to sell their land and a class system continued to grow, however, those with significant riches and land began to require people to protect their interests, which eventually led to the more modern samurai class.
Heian Period and the Shogun
Emperor Kammu hoped to expand his rule in northern Honshu during the 8th and 9th centuries (the Heian period), but his armies failed in their attempt to conquer the Emishi people. Thus, he turned to regional clans that had sprung up to conquer the Emishi, eventually naming their leaders Seiitaishogun or shogun. Kammu began to rely on the skill of these clans too much, and this led to the disbanding of the Imperial army. By 1100, such moves allowed powerful clans and their shoguns to assume effective control of Japan in both a military and political sense.
The Rise of the Kamakura
Though the Emperor within Japanese society had already effectively lost much of his control, Emperor Toba died in 1156 without an obvious successor. This led to a civil war amongst his sons known as the Hogen Rebellion. While this went on, the Minamoto and Taira clans battled one another for superiority. The Taira won, thus becoming the first samurai government or shogunate. This shogunate relegated the emperor to a mere figurehead even more so than he had already been. However, the Taira and Minamoto clans would once again come to blows in the Genpei War (1180-1185), this time with Minamoto claiming victory. Soon after, Minamoto no Yoritomo formed the Kamakura Shogunate, which ruled Japan until 1333. However, they were forced to fight off two successive Mongol attacks. Though both defenses were successful with help from nature (typhoons), the fighting took its toll.
Bushido and The Way of the Warrior
The foundations of the ethical code of Bushido began to take hold during the Heian period with the samurai. "The Way of the Warrior" or Bushido emphasized duty to one's master (in this case, usually a shogun) and loyalty until death. Buddhist and Zen principles likely contributed to the tenets of this via a belief in reincarnation. Along with this, samurai warriors believed that it was highly honorable to commit suicide or seppuka via disembowlment with a small sword after being defeated in battle (or upon dishonor). They would fight fearlessly for their masters and would rather die honorably either through seppuka or in battle than surrender in defeat.
Further, it was actually deemed legally appropriate for a samurai to cut down any common person that failed to honor him (or her) in appropriate fashion.
In other words, honor and integrity was everything to them.
Samurai in Battle
Previous to the Mongol invasion, the samurai were expert archers that often fought from horseback. Afterwards, however, they began to utilize full body armour in battle, usually including a horned helmet, as well as swords, poles tipped with blades, and spears. Along with this, during the 14th century a blacksmith named Masamune utilized a two-layer structure of soft and hard steel with swords, which led to improved cutting power and durability, eventually resulting in the Japanese katana. The katana became a part of the samurai daisho, which means "long and short". The katana was the long part of the equation, utilized for slashing, while the shorter part was the wakizashi, which was more useful as a stabbing tool. Eventually, the daisho became so synonymous with the samurai that non-samurai were literally forbidden to wear it (16th century).
Back to the Timeline: The Ashikaga Period
Emperor Go-Daigo twice attempted to take advantage of the weakened Kamakura following the Mongol invasions. His first attempt to seize control via armed forces failed. His second produced fruit in 1333. However, in 1336 the Ashikaga Shogunate under Ashikaga Takauji took control, once again establishing samurai rule.
Rise of the Daimyo
During the Ashikago Period, daimyos or regional constables began to assert a level of authority due to the weakened state of the shogun. In fact, by 1460 some daimyos began to ignore orders from their shoguns entirely. When Ashikago Yoshimasa resigned in 1464, fighting amongst possible successors and daimyo led to the Onin War. This war went on for 10 years and led to the "Warring States Period" or Sengoku.