The cost of equity will rise by an amount just sufficient to offset any possible saving or loss. The supply of debt is determined by the lenders. The optimal level is simply the maximum amount of debt which lenders are prepared to subscribe in any given circumstances. For example, level of inflation, rate of economic growth, level of profits etc. The investors will exercise their own leverage by mixing their own portfolio with debt and equity. They call this the Arbitrage process. Under these conditions of investments the average cost of capital is constant.
If two different firms which same level of business risks but with levels of gearing sold for different values, then shareholders would move from overvalued firm to the undervalued firm and adjust their level of borrowings through the market to maintain financial risk at the same level. The shareholders would increase their income through this method. While maintaining their net investment and risk at the same level. This process of arbitrage would dive the twice of the two firms to a common equilibrium total value.
The word arbitrage is a technical term referring to a situation where two identical commodities are selling in the same market for different prices, then the market will reach equilibrium by the dealers start buy at a lower price and sell at the higher price, thereby making profits. The increase in demand will force up the prices of a lower priced goods and increase in supply will force down the high priced commodities.