The cost of capital represents the return required by the investors (such as equity holders, preference holders or banks)
Basically the more risk you take, the more return you expect.
This risk is the likelihood of actual returns varying from forecast.
The return for the investors needs to be at least as much as what they can get from government gilts (these are seen as being risk free). On top of this they would like a return to cover the extra risk of giving the firm their investment.
The investors could be debt or share holders (debt and equity).
The cost of capital is made up of the cost of debt + cost of equity.
The cost of normal debt is cheaper than the cost of equity to the company. This is because interest on debt is paid out before dividends on shares are paid. Therefore the debt holders are taking less risk than equity holders and so expect less return.
Also debt is normally secured so again less risk is taken.
When a company cannot pay its debts and goes into liquidation, it must pay its creditors in the following order:
Creditors with a fixed charge
Creditors with a floating charge
Each of the above will cost the company more as it heads down the list. This is because each is taking more risk itself