The honorific language has three forms in Japanese, namely: sonkeigo（尊敬語）, kenjougo（謙譲語） and teineigo（丁寧語）, sonkeigo said to have the longest history. You will need to use that when you are talking to your superior, about his or her actions. On the other hand kenjougo should be used when you are talking to your superior, about your own actions. The third form (teineigo) doesn’t have this characteristic.
When treating Samurais, regardless of one's hierarchical status, he must show respect
Basically, the fragmentation of the Japanese society resulted in these three kinds of language forms. Since the society classes were not treated equally, when two people were talking to each other, it was necessary that they clearly differentiated each other. The one who was “below” the other had to elevate the partner by showing respect towards him or her. The society fragmented from time to time and the so-called “sonkeigo” turned out to be insufficient to express certain situations. Japanese people thought that when the gap between the partners was too large, it is not enough to show respect towards the partner, but one has to be humble. Therefore, they have formed a grammatical system called “kenjougo” and this is one of the main reasons, why the Japanese honorific language is complicated.
Keigo has changed since then and it still changes. It has experienced probably the most serious influence in the Edo period (江戸時代) from the Samurai society(武士社会). Interestingly, a person who was talking to a Samurai, regardless of his or her society class, could not use rude, or impolite phrases with the Samurai. This seemed to go against the previous rules of keigo, which strictly based on hierarchical relationships and this supposed to be the second reason, why the Japanese language is that complicated nowadays.
Samurai in Japanese is "bushi"（武士） or "buke"（武家）
That was the time, when the third form, so-called “teineigo” appeared. Furthermore, people talking in Japanese started to consider not only social status, but human relationships as well. As such not only Samurais, but farmers and people from the city, teachers and students and waiters and customers started to use different language forms.
The fact that one has to use different phrases talking to the same partner depending on the given situation makes the learning process more complicated and this phenomenon changes even today. Therefore, it indeed matters how for example a head of a department talks to the company president, or the waiter to the customer, or an employee in a given position to an employee of the same position but of a different company.
If we were to only consider the “keigo rules”, that are only dependent on hierarchical status, then, regardless of the situation, one should use similar phrases since one’s position in the society in a given timeframe can be considered as constant.
The expected level of politeness is also dependent on the "business situation"
However, depending on the “business situation”, the language that is actually used is different. Suppose for example one refers to his or her boss in the company. That time sonkeigo must be used. On the other hand, when he or she is talking to another company’s employee, but still referring to the boss, he/she should use kenjougo, such that he or she expresses respect towards the other company.
The sum it up, currently there is a grammatical system in the Japanese language, which has been formed by a natural process and it does not only consider hierarchical status. Even Japanese native speakers admit, that many of them cannot use keigo properly. If somebody would like to master honorific Japanese language, he or she must start with its history and later on will be able to use it accurately.
Learn About Keigo: NOW