Having an adversary is a strong motivator. Tribalism, one of the most powerful and primal forces in the human psyche is basically an "us vs them" mentality which serves to bind a group together to a common goal or communal advancement. Tapping into it is easily done and can be an effective way of motivating a team as long as it doesn't get out of hand. First task is to define "us". This is the hard part, but just talking about an "us" is enough to get started as people like being considered part of the in-crowd. Next is to create a "them". This may be "everyone else" but is more effective if it is a particular group. At that point you can sit back and let things take their natural course. The positive outcome is the spirit of competition driving "us" to be better than "them". In all likelihood you will also find that "we" start to dismiss, dislike and act against "them" - not something you want to encourage in your team in an office but behaviour which helps when attempting to defeat an adversary.
Narratively, a good adversary is a powerful encouragement to the reader to emotionally invest in your tale. Sympathetic villains can work well, but for a real "them" reaction you need someone to hate. Roleplaying games can make this very easy. The Demon Lord, The Death Knight or The Lich start off as an unambiguous "them" to the players' "us" and all they need to do is be evil enough to demonstrate that they are a threat and the players will throw themselves into hunting and killing them (and taking their stuff, obviously).
This only works with certain styles of game. My current campaign is focused on social encounters and political manoeuvrings. There are few cartoonishly evil enemies, but there are very definitely villains. The most obvious are already hated by their actions. They stand against the players on principal and are generally antagonistic at every opportunity. Another group has such a bad reputation that they are reviled despite having not actually done anything "on screen". Casting these factions as villains has been fun and I have one player who will accuse them of causing any and all bad events with no evidence whatsoever. Mission accomplished.
There are, however, other enemies out there. The clever ones who don't want to oppose, they want to win. They have done this by hiding in the shadows and striking in such a way that its not clear that they even exist. So far they have been successful enough that they haven't been revealed which is great for them but not so good narratively. I need to turn them into a known threat in order to make them a meaningful part of the story which means I need to somehow show the players that there is (at least) one hidden enemy and then, ideally, create a focus which can become a "them". At the same time I need to avoid devaluing them by having them fall into the common antagonist failures of over-reaching or collapse by internal treachery. Both of these cause the villains to lose rather than the heroes to win and robs the players of victory.
Until now I have been dropping clues into seemly unrelated encounters - a reoccurring detail here, someone knowing something they shouldn't there - which ties everything together and will either create a reveal or produce an "aha" moment at a later date. As this plotline comes to the fore, I need to escalate this threat without a cheap reveal. I have a story strand waiting in the wings which will raise the stakes nicely by making everything much more personal. At this stage I may need to alter some of the details to tie up some disparate plot elements and give the whole party something to hate together.
Not sure how I'm going to do that yet, but if I can use a "them" to also create an "us" I'll have solved another problem along the way. More on that another time.