The cost of debt capital is easy enough to understand. It is the interest rate, which is normally fixed, or at least it is determined in a relatively predictable fashion. The cost of equity capital is more difficult to grasp. It is not simply the dividend payments. Or more exactly, what happens when they don't match.
Equity capital absorbs the shortfalls or collects the windfalls.
The value of equity is the present value of all the cash flows equity investors expect to receive in the future, discounted at some rate. That discount rate is the cost of the equity capital. It is difficult to measure what investors are expecting for any given asset, but there is an extensive body of theory, data, and practice surrounding the concept of the cost of equity capital. My preference is to use the 10 year Treasury note yield, since 10 years corresponds to the period in which the most important cash flows occur for a stock. The longer the maturity used, the lower the ERP will be.