Think about a company as an entity that invests in projects with the goal of maximizing the time-adjusted return. The company must fund those projects with either debt or equity, and each funding source has a cost. The optimal debt load is one such that the projects undertaken by the company are funded at the lowest cost.