An Alignment is a team of players who share the same Faction or Team. Any true game of mafia will have an "Informed Minority" (that is, a small group of players who know who each other are) and an "Uninformed Majority" (a large group of players who do not know who each other are). Most of the time these are referred to as the Mafia and Town, respectively. It is also possible to have players who are aligned with third parties, such as Cults; or aligned with themselves, such as Survivors. However, as a general rule the Town vs. Mafia conflict should be center stage. The decision on who wins or loses a Game of Mafia is essentially always decided on a factional level. For instance, if the Town is the only faction remaining in the game, every member of the Town wins, even if they are not alive at the end of the game.
Certain roles are often more likely to be found in a particular alignment, this is due to their utility for each side. A Cop provides a Town significant utility for instance, whilst providing Mafia with near to none in most scenarios. You'll find roles sorted into the alignments they provide the most utility to.
This faction is the Informed Minority from which the game is named. A game is not "Mafia" if it does not include an informed minority (against which an uninformed majority, namely the Town, is pitted). Similarly, Werewolf is the namesake of its own game, which is functionally identical to Mafia. As part and parcel of being an informed minority, the members of the Mafia nearly always know who each other are. They may also speak to each other privately at Night, either via PM, instant messenger, or a specialized chat thread set up by the moderator.
This faction is the Uninformed Majority within the player set. While the Town is not explicitly structured as a Faction (that is, any given Townie does not know who else is on their team), everyone in the Town has the same Win Condition and should work together to eliminate Scum.
Third-parties have a Win Condition that differs from that of the Informed Minority as well as the Uninformed Majority. Third-parties can have any role, but specific roles such as Jester are designed to act specifically as one.