This is largely due to the Way of the Samurai.
Contrary to common belief, Samurai refers to the person or the warrior and not the sword. Below is a reader-friendly rundown on how the Samurai developed its discipline and philosophy and earned the respect the whole world is giving them.
663 AD: Battle of Hakusukinoe
The Battle of Hakusukinoe is the confrontation between the Tang Dynasty forces of China and the Yamato troops of Japan. The real war was between three provinces, Baekje, Silla and Goguryeo located in Korea. China was an aid of Silla, while Japan was aiding Baekje, an aid of Goguryeo.
When China and Silla decided to attack Goguryeo, they knew they had to eliminate Baekje first. Baekje, then asked for Japan’s help. Japan had more men but the battle happened in the Geum river. Tang forces covered the entrance and held their place. Yamato forces assaulted thrice and lost each time. As their casualties rose, they decided to retreat. It is their greatest defeat in modern history and it is also what made them realize that they need to strengthen their army.
646 AD: Taika Reform
When Emperor KÅtoku (KÅtoku-tennÅ) ousted the Sogo clan and Prince ShÅtoku died, he took the name Taika and wrote the Taika Reform with Crown Prince Naka no Åe (who would later reign as Emperor Tenji) and Nakatomi no Kamatari. It was a reform modelled after China. In fact, they sent students to learn the writing system, culture, and other important things in China. It established provinces, imperial courts and federal law. This reform will take hundreds of years to complete but it did establish one thing that’s important, a census. Through this reform, Japan was able to account for each of their citizen.
702 AD: TaihÅ Code
When Emperor Mommu got a grasp of the population distribution, he required 1in 3 males to report for the Military. These “soldiers” must supply their own weapons but they were exempted from taxes. There were 12 classifications with each rank having two subdivisions. The first rank is the highest and has closer contact with the highest leaders.
Those with 6th rank and below are “commoners” which they called Samurais. They were considered civilians but served the military. This is an important development. Although they were considered the “lowest ranking military men”, they were in-charged of daily activities which gave them direct contact with the people.
7th to 9th Century: Decline of the Emperor’s Power and Birth of Bushido
Although it is believed that it was Emperor Keiko, Prince Yamato’s father (see Battle of Hakusukinoe above), was the first emperor to call himself a Shogun, it was re-introduced by Emperor Kammu. He called himself a sei'i-taishÅgun or Shogun. It literally means Barbarian-subduing General. However, he eventually disbanded his army when different rich clans put themselves in power as ministers. These powerful families married among themselves and eventually became richer.
Some clans were formed by poorer families who rebelled against the richer clans to protect themselves. They wrote a code, a set of rules to make sure they remain faithful to their objective. They called this the Bushido or the Way of the Warrior. Their duty is to preserve the honor of each family in their community. However, their master is their code and their code dictates that they serve one master.
They eventually trained themselves in fighting, developed weapons and a unique philosophy of by honor and loyalty to its one master to death.
10th Century: Rise of the Samurai
When Japan became highly divided, governors started offering payment to warriors who will defend their province. Bushido practitioners, mostly Samurais, came forward. The reputation they slowly built through their display of fighting skills is what eventually earned them an elite status in the society. They became highly sought after. This prompted the Samurais to train even harder.
12th Century: Samurai Leadership
By the 11th century, clans were fighting each other and two rose to power, Taira and Minamoto clans. The war ended when one of the best Samurais, Minamoto Yoshitsune, charged and defeated the Taira. Minamoto Yoritomo became a military dictator and gave Samurais a lot of power. He elevated the status of Samurais. This earned him the Samurais’ loyalty.
Right around the same time, Zen Buddhism came to Japan. The philosophy of salvation residing within the self became attractive to the Samurais. Zen Buddhism also allowed Samurais to not be afraid of death, believing that dishonour is worse than death.
This is also when the sword became an official symbol of their nobility and honor. They believe that their sword is an extension of themselves. It may only be used for noble purposes. It is similar to how soldiers nowadays look at their guns. It is an extension of themselves and may only be used when they need to defend their country.
The Samurai supremacy was further established when China attacked Japan twice. In both times, Japan was outnumbered but the Samurais lack of fear for death allowed them to fight.
14th Century: Kusunoki Masashige
Kusonoki Masashige is some sort of a poster boy for the Bushido Code. When Emperor Go-Daigo rejected his recommendation on how to attack enemies, Masashige carried out a mission based on the Emperor’s order even though he knew they were going to lose. When they knew they wouldn’t emerge victors, he and his 600 men, committed seppuku or ritual suicide. They consider dying on enemy ground dishonourable and opted to kill themselves.
16 Century: Toyotomi Hideyoshi and Introduction of Guns
By the end of 15h century, china started developing firearms. Samurais rejected this in the beginning but eventually realized they needed to catch up. Hideyoshi, a Samurai, was able to take control of the whole of Japan, the first time it happened. However, he died when he attempted to conquer China and Korea. Tokugawa Ieyasu took over and was bent on uniting Japan.
Another Samurai, Torii Mototada, served Ieyasu. Ieyasu needed to go to Sekigahara but also had to defend the Fushimi Castle lest the whole army of the enemy will just follow them. Torii and Tokugawa knew the castle will be taken over but it they needed to defend it for the sake of their oath and to buy Ieyasu time. Torii volunteered to stay behind with 2,000 men. They fought for ten days and when no hope was in sight, they committed Seppuki.
Torii did delay the enemy and allowed Ieyasu to win in Sekigahara.
By the 17th Century, Japan is finally living in peace and more powerful firearms were being developed. Samurais finally had no enemies to fight. They still had the right to kill anyone who disrespected them but with no duty to serve, they started becoming obsolete. The one thing that survives, is their loyalty to their master.
19th Century: Beginning of the End
When Commodore Matthew Perry of the US pushed for trade with Japan, Japan opened its doors to Western influence. Japan became exposed to the power that modernization could bring. They slowly modernized their military which spelled the end of the Samurai.