Well, you've got the gist of it, really.
There are two sides: town (good) and scum (bad), with about three times as many people in town as on the scum side. Townies know that they themselves are town, but don't know which side anybody else is on. Scumbags know who's on their side and can talk to them freely outside of the game (through PMs, in chat, whatever). Every "day" (which usually lasts two to three real days) people vote for whoever they think is most likely to be scum, and that person is removed from the game. Then there's a "night" phase when the scum can choose one person to "kill," and the cycle repeats. Town wins when all the scum are gone, and the scum win when they make up at least 50% of the players (and therefore can control the voting).
Most games also give players special powers, which can do whatever the game moderator feels like making them do. The most common ones include the "doctor", who can protect one person per night from being killed, the "cop," who can investigate one person per night and learn their alignment, the "bulletproof," who can't be killed at night, and the "vigilante," a non-scum player who can kill one person per night.