Betrayal

The act of leaving one group and joining another one, which is the betrayed team's enemy or rival. In fiction, it's more likely for a protagonist to commit betrayal than it is for an antagonist for the sake of drama and Hurting The Audience. When the Good Guys are betrayed, it's up to them to make their best effort to bring their traitor of an ally back on to their side. That is, of course, if they aren't too mad at the Traitor to want them back. In cases of an ally joining the enemy against their will, that isn't betrayal as it wasn't their choice to leave their friends.

Someone can betray their allies for many reasons. One is the enemy seems to be stronger and better at what they do than the soon-to-be Traitor's own group. The other is the Traitor is tired of how they've been mistreated by people who were supposed to be their friends and want to quit the team.