Pidgins often arise in wartime or sporadic trade situations as a lingua franca for the necessary communication. There is frequently a power differential involved.
In more long-term situations where groups speak different languages, such as colonization/occupation or slavery, a pidgin may evolve into a creole, which is considered a language unto itself.