The way you worded it makes it sound like you think the cap is a pool of money separate from your funds and which is used to pay salaries. This is not accurate. The cap is just the total player expense (salary + amortized bonus) for your team allowed in a given season.
Both salary and bonus are expenses come out of your funds and both count against the cap as well. The differences are in the timing of the funds being deducted from your funds and the fact that bonus will generate cap penalties if you cut or trade the player before the end of the contract.
Here's a bit more detail:
Salary: 1/17th of the yearly amount will be deducted from your funds every regular season week as you pay your players. The annual amount counts against the cap. You are not liable to incur cap penalties for that amount if you cut or trade the player.
Bonus: This amount for the entire contract is deducted from your funds at signing. The average yearly value counts against your cap each year. If you cut or trade the player, the remaining portion of his bonus which has yet to be counted against the cap becomes a cap penalty on next season's cap.
For example if you give a 20 million dollar bonus on a 5 year contract at 17 million dollars per year salary, the 20 million comes out of your funds at signing and you will have a 1 million dollar expense per week in your funds to account for the salary. The contract counts 21 million dollars (17 million salary + 4 million per year bonus) against the cap each year.
So that contract will cost you 37 million dollars of funds the first year and 17 million for the four remaining years. The contract counts 21 million dollars (17 million salary + 4 million per year bonus) against the cap each year.
If you cut or trade the player after 3 years, You will have an 8 million dollar cap penalty on the next year's cap to account for the remaining 2 years worth of bonus that you paid up front but have yet to be applied to the cap.
I hope this helps.