Compensatory picks are based on the number of free agents a team loses in relation to the number of free agents it gains......AND the quality of the free agents lost/gained.
If you lose more qualifying FAs than you gain then you get compensatory picks equal in number to the difference between your lost/gained...up to a max of 4. If you gain more than you lose, then you dont get any.
If you are indeed awarded compensatory picks, where they are slotted depends on the quality of the gained FAs vs. the quality of the ones you lost.
"Quality" is determined by factors such as playing time, salary, and post season awards/honors. No compensatory picks are slotted any higher than the 3rd round.