There are many games with what can only be described as the Traitor Mechanic. In some games, such as Mafia, treachery and deceit are central to the game; you are trying to discover each person's role, with not much else on top of that. In other games, it's more of a subtle feature, usually involving variable win conditions for each player or team, but with more traditional gameplay mechanics for the main duration of the game. In the following descriptions, I'll sketch out how the "traitor" mechanics work for each game versus how the whole game works. Hopefully learning these games can influence your future designs.
The Best Traitor Tabletop Games,
Betrayal at House on the Hill
Shadows Over Camelot
Diplomacy
Battlestar Galactica
The Resistance
Shadow Hunters
Dead of Winter
Spyfall
Werewolf
Lifeboat