WoWWiki defines the tag as damaging a mob, thereby reserving the monster or NPC for you and your party so that only you may loot or gain XP from it. It also turns the status bar of the mob gray to other players to indicate that it has been tagged by another player. Rufushonkeriv asks an interesting question over at LiveJournal, however, about kill stealing and how it can happen in World of Warcraft. The tagging mechanism, which isn't present in more than a few MMOs, is supposed to prevent kill stealing in the game.
However, the poster asks how a mob he has tagged is sometimes tagged away from him and explains how, when attempting the same thing, he only ends up killing a grayed-out mob faster. It is quite possible that the poster uses a DoT spell to get a mob's aggro, only to lose it to another player who deals damage with an instant cast spell. Lag can also sometimes explain how a player might think she damaged a mob first, only to have it turn gray when another player hits it.
Technically, the first player to damage a mob tags it -- it isn't the player who has aggro or the player who first cast a non-damaging spell on the mob (such as Mana Tap or Hunter's Mark). There is some confusion as to the amount of damage needed to secure the tag. For example, if a player damages a mob for 1 point and a second later another player hits it for 1,000... who tags the mob? In theory, it should be the player who hit the mob for 1, because she damaged the mob first. The mechanic is pretty straightforward but in some cases players are confuddled through a mix of lag, lack of understanding about the tagging rules, and just plain old bad luck. As a rule of thumb, when tagging, hit it fast and hit it hard!