There are two phases in the game - the night phase and the day phase. In the night phase the "mafia-members" - who all know one another since they are the informed minority - choose among themselves to "kill" an innocent. In the day phase all the players (including "mafia-members" whom no one knows as what they really are!) discuss regarding who the "mafia-members" could be and reach an agreement to kill one of them.
Thus the players keep getting eliminated through getting "killed" either by "mafia-members" or by the "townspeople". "Mafia-members" would never "kill" their own since they know, but the "townspeople" can since they don't know though they have the privilege of being more in number to be "killed" in the game.
The game continues till only either the "mafia-members" or the "townspeople" survive and there is no more left to be "killed".
Obviously the team that survives wins the battle. The bigger the group to play as is generally the case in the online versions of the game, the more the enjoyment in the fun party games that the famous Mafia aka Werewolf aka Assassin belongs to!