Every year, free agents are ranked. They're divided into Type A (top 20% at position) and Type B (between 21% and 40% as position) free agents. Players are ranked in groups. 1) 1b/DH/OF 2) 2b/SS/3b 3) catchers 4)starting pitchers 5) relief pitchers. This system actually creates some very weird situations. Sergio Romo was a Type A the same year Troy Tulowitzki wasa Type B. Go figure.
So if a team signs a Type A free agent, the team who LOST the free agent is compensated with two draft picks. The slots of those draft picks are determined by last year's record. One if DEFINITELY a "supplemental round" pick. The supplemental round falls directly after the first round (also known as a sandwich pick). The other draft pick is based upon the signing team's previous years record. I believe the top 15 (or 20?) teams cannot lose their first round draft pick. So if they were to sign a Type A, they'd give their SECOND round pick to the free agents previous team.
Type B free agents only net a supplemental round pick.
There are also rules in place about the number of free agents you can sign. Here's a quip froma website:
<div style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; OVERFLOW: hidden; BORDER-LEFT: medium none; COLOR: #000000; BORDER-BOTTOM: medium none; BACKGROUND-COLOR: transparent; TEXT-ALIGN: left; TEXT-DECORATION: none">
If only 0-14 players in all of Major League Baseball file for free file for free agency, no team may sign more than one "Type A" or "Type B" player (terms defined below).</p>
If 15-38 players file for free agency, no team may sign more than 2 such free agent players.</p>
If 39-62 players file for free agency, no team may sign more than 3 such free agent players.</p>
If 63 or more players file for free agency, then there are no such limits applied. Furthermore, a team may sign as many type A and B free agents as it has lost, regardless of the limits above.
</p>
</p></div>It's also important to note, that the player must be offered arbitration to become a Type A or Type B. If the player is not offered arbitration, he's just a free agent, available to sign anywhere without any penalty to the team that signs him.
Hope that helps.