From CBS Sportsline last year:
Under terms of the NFL Collective Bargaining Agreement, a team losing more or better compensatory free agents than it acquires in a year is eligible to receive compensatory draft picks.
The number of picks a team receives equals the net loss of compensatory free agents up to a maximum of four. The 32 compensatory choices announced today will supplement the 220 choices in the seven rounds of the 2008 NFL Draft (April 26-27). This year, the compensatory picks will be positioned within the third through seventh rounds based on the value of the compensatory free agents lost.
Compensatory free agents are determined by a formula based on salary, playing time and postseason honors. The formula was developed by the NFL Management Council. Not every free agent lost or signed by a club is covered by this formula.
From what I have seen historically, the best draft pick position a team can get compensation for is the end of the third round. (Has anyone seen a compensation pick in round 2?.. I cannot recall one.)
Updated: the Giants received a third round pick #100 in the draft. To have a #1, two #2′s and two #3′s is some haul.