Not sure why you think Berkshire Hathaway doesn't have any debt. The company is a direct and indirect issuer of Corporate Bonds among other forms of debt, including bank loans, asset securitizations, leasing, etc. Check their most recent 10-K, they have over $100 BILLION in Debt issued directly by Berkshire, wholly owned subsidiaries, and consolidated investments.
If you don't have debt, it means you are 100% equity financed. Equity is the most expensive form of financing. A well-run company will be an attractive credit risk and can get debt at a cost much less than the cost of equity.
For simplicity sake, assume that investors require 12% return on investment for equity (stock ownership), whereas debt investors are willing to lend money at 6% as long as the company doesn't have more than 50% of their capital from debt. The all-equity company has a cost of capital of 12%. The company with 50% debt has a cost of capital of 9% (0.5x12% + 0.5x6% = 9%). I'm ignoring tax effects, but that would lower the cost even further for the 50% debt company as interest expense is deductible.
A good company uses the debt financing to invest in projects (buy ships?) that produce a return in excess of the cost of the financing. All of those returns go to the equity holders after the debt is repaid. A project is evaluated on this basis by prudent managers. There are several ways to do it, including payback period, IRR, NPV, etc. NPV is probably best for long-term asset investments like ships - they have a long life span.