Description
http://docs.mongodb.org/manual/reference/method/rs.add/
This doc page says:
This function will disconnect the shell briefly and forces a reconnection as the replica set renegotiates which member will be primary. As a result, the shell will display an error even if this command succeeds.
This actually isn't always the case. Often times you can use rs.add() to add members and the shell will stay connected. The primary only disconnects its connections if adding the member results in a stepdown/election occurring.
I am not sure if this behavior has always been so in older versions, but it seems to be the case at least as early as 2.4.x.