This game mechanic is used within games to increase the popularity of it by allowing players to invite friends to come and play. The reason for doing this is because it will give players rewards for inviting the new players. The name of this mechanic is self explanatory as it allows he game to become more viral
One of the best examples of a game that uses this mechanic is Farmville. This game is a mini game that can be accessed on on Facebook. The aim of the game is to grow and expand your farm. While doing this you can invite your friends on Facebook to come and play the game. In doing so this will give you experience that will level you up and unlock more items for your farm. You can then visit the other players farms and do tasks that allow the players to advance.
In Star Wars: The Old Republic this mechanic is also used. If a player is referred using a link that an existing player has given them it will give the new player a discount offer for a subscription to the game. When this is done it will then give the existing player in game rewards such as micro transaction credits or unique items. This mechanic works extremely well in this game as it allows players to play for a cheaper price. Since it also gives rewards it encourages existing players to try to get more friends on to the game.
I feel like if I was to use this mechanic in my own game I think it would work best in a browser game similar to Farmville or like the ones on Miniclip. This is because these are already popular sites that you are connected to people on. This means that is easy to invite a player to join the game and has a higher chance of gaining more players than using this mechanic in any other type of game.