And then you both attempt the door, bumping into each other and making a scene. Instead, I'd like to explore why we are courteous to each other. We are conditioned to do so. We are products of our society, and therefore have been trained to say certain things and behave in certain ways, especially with strangers or acquaintances. Well, yes and no.
Conditioning is relative to culture.
I grew up in the South. I say hello to my neighbors when they are sitting outside on their porch. I offer people something to drink when they come into my home. You probably won' t find that in New York City or most parts of New England. People are generally more rude and crass, especially with strangers.