Torie Bosch explains it in Slate’s Explainer:
We’re all guilty of changing the way we speak in subtle ways, depending on whom we’re talking to. Linguists call this “code shifting”—you don’t want to talk to your boss the same way you talk to your old college roommates. We often code shift subconsciously, by picking up other people’s speech patterns (as anyone who has ever studied abroad probably knows).
Posted May 2, 2007