Confucius lived in China about 500-and-something BC. He gave lots of thought to the proper way of living in this world. In fact he more or less invented the system of thought that has dominated Asian society until, well, today. Of course, over the last 2,600 years many people have interpreted, re-interpreted, and re-re-interpreted him, but Confucius' impact on Asia has arguably been more profound than that of Jesus on Europe. In any case, Confucius ranks up there with Jesus, Muhammad, and the Buddha as one of the most influential thinkers ever. Confucius, unlike the other three mentioned above, was not interested in the afterlife. He is reputed to have said that he would worry about the next world only after figuring out the proper way to live in this one.
What is the proper way to live in this one? Confucius believed that everyone had their role to play based on their relationship to others. If everyone fulfilled their duties and kept their place then society would be stable and harmonious. Obviously, this is a rather conservative philosophy. There are five basic human relationships in Confucianism: (1) ruler to ruled; (2) father to son; (3) husband to wife; (4) elder brother to younger brother; and (5) friend to friend. For Confucius and his followers, the relationship between father and son was the most important. You've no doubt heard of ``filial piety'' and with good reason - it is THE virtue for Confucianists. Confucius also incorporated the notion of the four classes: the scholar, the peasants, the artisans (a.k.a. craftsmen), and the lowest of the low, the merchant. Notice two things, the place of the peasant and the absence of warriors. Confucianism had no need of war, because if everyone is following their proper role then there should be no war. If there is war, then Confucianism is out the window anyway. China never glorified the warrior as much as Japan and Europe did. Also, the class order put peasants second since they provided the food that everyone else needed to live. Artisans at least make useful things, but merchants were viewed as parasites whose only purpose was to live (and get rich) off the sweat of others' labor.
Why is the father-son relationship more important than the ruler-ruled relationship? Good question. Because the ruler is supposed to set a moral example for his people and rule with a paternalistic attitude toward his subjects. Thus, he is expected to rule like a father rules his family. If he had to use his position (rather than personal example) to keep the others in line then he obviously wasn't a worthy ruler. Here's the kicker: the Chinese came to believe that Heaven didn't recognize the right to power of an unworthy ruler. Thus, if there are rebellions and natural disasters in the land, it is because the Emperor is not fulfilling his proper duties. For Confucianists this is a much greater sin because the Emperor, as head of the household, has more responsibility in addition to more power. A second son has little responsibility and less power, so his sins are correspondingly less destructive to the family. End result: if you rebel and win then society views you as the legitimate ruler, since if the previous ruler had been fulfilling his Confucian duties properly you could never have successfully rebelled. (Kind of twisted logic, but who said human societies are logical?)
All this is really nice, but what does it have to do with Japanese history? A lot actually. After establishing his government, Tokugawa Ieyasu consciously encouraged the study and spread of Confucianism. However, in Japan a few little elements were dropped. First, the idea that a ruler could be legitimately overthrown wasn't real popular with the Tokugawa family. Also, since the samurai had a monopoly on power they inserted themselves at the top of the list of classes--``scholars'' became ``samurai.'' However, most samurai had a decent education and during Tokugawa rule they were expected to be well educated as well as good with a sword. To accommodate the change in policy against rebellion, the most important relationship was changed from father-son to ruler-ruled. The father-son relationship was still quite important, but it became secondary. Confucianism continued to be stressed and taught to children in Japan right up to 1945.