Cost of capital is the minimum rate of return a company must earn before generating value. It is calculated by a business's accounting department to determine financial risk and whether an investment is justified. There are different components that make up a company's overall cost of capital, including the cost of debt, equity, preference shares, and retained earnings. These costs are weighted and combined to calculate the weighted average cost of capital, which is used to evaluate potential investments.