Credit Default Swaps (CDSs) enable investors to hedge the risk of bond (or other credit securities) default. Like any derivative, they essentially allow investors to transfer risk -- from hedgers to speculators (or even between hedgers or speculators with different exposures). See article here, Reuters.
Dolvin, Steven D., "China Looks to Add Credit Default Swaps" (2016). All Chapters. 161.