Capital structure can affect the cost of capital because the mix of equity and debt financing in a company's capital structure can impact the risk perception of investors and lenders.