Assume I need to hedge some credit risk. I can buy a bond or cds for it. I see the second option is almost free while the first cost as much as face. Why would people use bonds at all for hedging then?
Since you are looking to BUY a bond, can I assume your existing position that your are trying to hedge is a SHORT credit risk of an entity?
Assuming you are SHORT the credit risk of an entity, I outline 2 scenarios:
(A) You are SHORT the bonds
If you are SHORT the bonds, why not just BUY the bonds back? This would be the most effective neutralization of the credit risk you would have on as it would match the bond on all the fixed income risks as well.
(B) You are borrowing from the entity
If you are borrowing from the entity, they have credit risk to you. And therefore you wouldn't need to hedge their credit risk.
So assuming you are really LONG the credit risk, 2 scenarios:
(a) You are actually LONG the bonds
Again, why not just sell the bonds? Again, most effective hedge. If you can't sell the bonds, or like some other feature of the bonds you own (such as the options exposures of a convertible bond), you could SHORT other bonds of the same entity. You would receive the proceeds from this new SHORT position, which you could then reinvest. And you would have to pay the costs of borrowing the bond to short. Additionally, you would probably have to post some initial margin for your short bond position (which has the additional risk of potentially being recalled, at which time you would have to relocate the bond.)
(b) You have loaned the entity and are unable to get out of the contract.
Again, shorting some of their debt would hedge the credit risk.
In using CDS, you would be buying protection on the entity. In this case you would be paying premium to the seller of protection. The seller of protection has credit risk to you and may require an up-front payment from you (as per the contract terms of standardized CDS--as a result of credit risk to the protection buyer after "big bang"). This may cost you more than the initial margin you would have to post on your short bond position.
The CDS (as a standardized contract) is a less effective hedge in that it probably has more basis risk to the position you are trying to hedge. You would have to manage the other risk over the term of the hedge. A SHORT bond position may be more effective hedge or not, depending on the mismatch between the hedge and your long exposure, which would also need to be managed. Also, as mentioned above, the short bond position is subject to recall (a good prime broker would be able to help with this.)