Japanese culture seems to focus on respect and "knowing one's place" Where did this originate?
My observation of a sort of Caste originates from old Japanese movies, by the by so I may be off base there.
The lines that divided social classes were only really solidified during the Edo Period, after the tumultuous Sengoku Period.
During the Heian Period, there was some social mobility due to limited use of the civil service exam system that was emulated based on China's.
During the various wars and with the rise of the samurai, conflict made for great opportunities for lowly commoners to rise above the chaos and seize new positions of influence and power for themselves.
There's even a word specifically for the overthrowing of your superiors in Japanese: 下克上 gekokujo
It literally means 'those below replacing those above'.
This was the rationale behind betraying one's master and other such things.
This was also a huge ideal during World War 2 Japan, and a major reason why Japanese military units were very difficult to control out in the field.
But onto the main discussion.
A large influence on the sense of propriety in Japanese culture surely came from Confucianism, as well as Neo Confucianism.
Confucianism, simply speaking, deals a great deal with everyone's proper place in life, and how a good life and a harmonious society come from doing the right thing.
This value is cemented in the importance of protecting the key relationships.
These are:
Father and son
Lord and vassal
Husband and wife
Sibling and sibling
Friend and friend
It was said that all other relationships could be rendered down to these basic 5 and to live well, it was important to maintain these relationships with the proper manner and attitude. And of course, showing the proper care and respect when dealing with others was of huge importance for living a good life and contributing to society.
This certainly went a long way to cementing the mode of thinking about 'knowing one's place' and 'respect' in Japanese culture (and other Asian cultures as well).
Fun side fact, in Japanese, one of the most commonly used phrases for 'know your place' is 身の程 mi no hodo, which literally means 'the limit of one's body/self'.
Linguistically, it has a much more definite feel to it than our English phrase 'to know one's place/station/rank'.
Of course, nowadays it's considered a phrase pretty much uttered exclusively by snooty, arrogant fictional characters.