Looks like no one added any tags here yet for you.
Proximity effect may have several potential explanations.
Friendship may be induced by simple courtesy norms: \n you run into each other, so you must engage in some sort of polite interaction.
Friendship may be the result of the expectation of future interactions: you will keep running into each other, so for things not to be awkward you need to establish a friendly relationship.