Largely, but not entirely, correct.
Only certain UFAs count in the calculations. The short version is:
* The player must not have been waived by his old team.
* The player must sign a contract with his new team before a certain deadline, and must remain on the team for a certain length of time.
* The player must sign a contract worth at least slightly more than the vet minimum.
No team that has signed more qualifying FAs than it lost has ever gotten a comp pick.
When teams lose more than they sign, they try to "cancel out" contracts as best they can (i.e., a player with a $1M contract will cancel out a $2M contract instead of a $6M contract). [The primary determinant of what round a pick is slotted in is the average annual value of the contract.]
If a team loses as many as it signs, it may get a late comp 7 if the players lost are significantly better than the players signed.