“They just need time . . . You gave them something better, a common enemy.”
-Agent Coulson, Agents of S.H.I.E.L.D.
In fiction, we like to work with disparate groups. We enjoy writing and reading about characters from a seemingly random array of backgrounds coming together. On one hand, this lets us explore human relations. On another, it creates drama and tension. It’s also fairly realistic. But no group can work as disunited, arguing, individuals forever. Eventually, they need to come together and use some teamwork. In short stories, novellas, and stand alone novels, we typically don’t have the space for long term team development, the time referred to by Coulson above, so we often use the trope of the common enemy (or common sacrifice) to speed up the process.
Some genres and media are better suited to the long term method of team building than others. For example, the Avengers and X-Men comics were very good at this. Ultimately, the team members learn to work together and even respect each other, even if they don’t agree or don’t like each other. And this comes with time. Leverage does this well too, since the team doesn’t get a significant common enemy until at least a season into the series. Star Trek: TNG and DS9 are also good examples. Both series took a couple seasons before the characters and cast hit their stride and really became a team. Babylon 5 is also a good example, since most of the fifth season “team” didn’t really start to come together until the third or fourth season.
The common enemy approach is also quite common. Obviously Agents noted above, which builds out of the Avengers movieverse, where the tactic is used via Coulson and Nick Fury. Farscape is another good example, the completely random assortment of species, backgrounds, social classes, and everything else is initially held together solely by the threat of Peacekeeper retaliation, in the form of Craise then Scorpius. The Fellowship of the Ring is another classic example in that it wouldn’t exist if the threat of Sauron wasn’t there. The Council of Elrond that created the Fellowship wouldn’t have been convened without Sauron.
In fiction, the common enemy can be a great method of forcing a team together. It creates unity quickly and most works of fiction don’t last long enough to cause problems. In reality, the common enemy is also used quite a bit, typically in the form of the Us versus Them language and mentality. We see this all over the place, throughout history – the view of Jews during the Middle Ages, the Nazis, Israel’s relation with Palestine, the Cold War. If a society, for example, relies on the common enemy to create unity in the long term, it starts to cause problems. We see McCarthyism, we see censorship (see Ray Bradbury), we see the U.S. in the last couple decades since the end of the Cold War (since then, a certain segment of the population has been seeking a new Other as enemy; it most recently tried terrorism, but that’s too nebulous, not concrete enough to be a good, unifying common enemy).