andyb's right here. The current system (soon to be changed):
IF a free agent receives a "qualifying offer" from his old team, and if he declines that offer, his old team gets a compensatory draft pick after the first round in next summer's draft; if the player signs with a different team, the team signing him forfeits a draft pick. If the signing team is drafting in the top 10 picks, they don't forfeit that pick, but rather their second pick. (Note: their second pick, but not necessarily their second-round pick - whatever their second pick is.) Teams who are drafting later than the top ten picks forfeit their first pick.
The "qualifying offer" is a fixed, one-year salary offer, that's calculated by MLB as the average of the top 125 salaries in the game. This winter, it was $17.2 million. (It will be higher next winter.)
The changes under the new CBA (effective next winter, and in the 2018 draft) have to do with when a team losing a "qualified" free agent gets a comp pick, and what pick(s) a signing team forfeits. It's complicated - see the MLB CBA thread. Most significantly, no signing team will ever lose their first-round pick.