Bonuses deemed "Likely to be earned" count just like salary. Some of the incentives mentioned in this thread like the Davis' 2500 yards would probably not qualify. The CBA has calculations for rookie contracts to determine how much is "likely to be earned". Veterans are based on their previous performance. If there is a dispute over how likely an incentive is to be earned, it's off to arbitration. The key is that the incentives count just like salary against the cap. The CBA gives the money back the next season in the form of additional cap room if the incentive is not reached. This is why you rarely see reports of how much a team as spent, only how much they have left. The total they get to spend varies due to these credits for unearned "likely to be earned" incentive bonuses.
Here is basically how it works. Let's say that a team is $4 million under the cap. They only see a need to keep $ 2 million available for some unexpected signing they may choose to make such as injury replacements. That gives them $ 2 million with which to work. So they look at their roster and here is a young backup Guard who may have a year left on his contract but he is starting to develope so they want to keep him. They work out a restructure that adds 2 years plus a half million roster bonus this year (that way it all counts this year and does affect next year) , keeps his pay at the league minimum for all years, and adds an incentive that pays him $ 1 million if he is in the top 10 on the team in special team tackles. That gets deemed a likely to be earned bonus so it counts all this year. So this guys cap hit now is less than 2 million (LTBE bonus+ roster bonus + salary) and the team still has 2.5 million to spend and has sewed up another Guard they wanted to keep for 2 more years. They don't mind that money on the cap this year since they weren't using it anyway.
But the team has gained even more. They never use this guy on special teams so he doesn't earn that $ 1 million bonus. The team now gets to add it back onto their cap for the next year meaning tht is the rest of the leagues cap is 50 million, their's is 51. So not only do they get a good young player locked up for a few more years, they get more cap room in subsequent years. The Eagles and Pats heve been doing this for a few years now but eventually they will top out a payroll.