The S&P 500 returned 27.5% during the three-year period ended Sept. 30, but Berkshire Hathaway beat the market with a return of 32.4% in its equity securities portfolio. CEO Warren Buffett deserves much of the credit for that outperformance, and his knack for picking winning stocks makes him an excellent source of inspiration.

With that in mind, Berkshire had $157 billion invested in Apple (AAPL -0.35%) and $22 billion invested in The Coca-Cola Company (KO) as of Sept. 30. This means the company had 56% of its $318 billion portfolio invested in just two stocks.

Here's what investors should know about Apple and Coca-Cola.

Apple: A consumer electronics leader comprising 49% of Berkshire's portfolio

Warren Buffett says the most important quality a company can possess is a durable economic moat, which generally amounts to cost advantages or pricing power. Apple fits that mold perfectly.

Its economic moat arises from brand authority, patented technology, and switching costs. Specifically, the company pairs trendy hardware and proprietary iOS software to create a unique user experience that supports premium pricing and drives consumer loyalty.

Indeed, Apple has earned a strong presence in several consumer electronics markets, including smartphones, personal computers, tablets, and smartwatches. That strong positioning should support mid-single-digit revenue growth across its lineup of devices for years to come as the broader consumer electronics market is forecast to expand at 6.6% annually through 2030.

Additionally, Apple aims to monetize its installed base (which exceeds 2 billion active devices) with adjacent services like App Store downloads, iCloud storage, Apple Pay, and subscription products like Apple Music. That strategy not only broadens its addressable market, but also supports greater profitability because services earn higher margins than devices.

Apple reported mixed financial results in the fiscal fourth quarter (ended Sept. 30). Total revenue fell about 1% to $89.5 billion due to substantial weakness in the Mac and iPad product lines. But GAAP earnings increased 13% to $1.46 per diluted share due to strength in the services business and stock buybacks.

Going forward, Wall Street expects Apple to grow earnings per share at 10% annually over the long term. That forecast makes its current valuation of 31.3x earnings look relatively expensive, especially when the three-year average is 28.4x earnings.

I doubt Apple can deliver market-beating returns from its current valuation, so I have no intention of adding this stock to my portfolio. But Buffett clearly has high conviction in the company.

Coca-Cola: A Dividend King comprising 7% of Berkshire's portfolio

Like Apple, Coca-Cola has a durable economic moat built on scale and brand strength. The company makes its products available in more than 200 countries via an unmatched network of bottling and distribution partners and has cultivated brand authority (and pricing power) through brilliant marketing in many of those geographies. Indeed, Coca-Cola was recently recognized as the most valuable nonalcoholic beverages brand for the sixth year running.

The combination of prodigious scale and brand authority has positioned Coca-Cola as the market leader in carbonated soft drinks in virtually every geographic region on the planet, and the company is still gaining ground. For instance, its share of U.S. carbonated soft-drink sales reached a multidecade high of 46.3% in 2022, nearly eclipsing PepsiCo's market share twice over.

Coca-Cola reported solid financial results in the third quarter. Revenue rose 8% to $12 billion due to price increases and modest growth in product volume, and GAAP earnings increased 9% to $0.71 per share. But management sees plenty of room to run with a $1.3 trillion addressable market, and the company has compelling opportunities in emerging markets, like Latin America and Asia-Pacific, and in noncarbonated beverage categories, like coffee and sports drinks.

Looking forward, Wall Street expects long-term annual earnings growth of 6% on a per-share basis. In that context, the stock looks relatively expensive at 23.1x earnings. Coca-Cola has underperformed the S&P 500 consistently over the last decade, and I doubt shareholders will see market-beating returns from the current valuation.

However, Coca-Cola currently pays a quarterly dividend of $0.46 per share, which equates to an above average dividend yield of 3.2%. Better yet, the payout has increased for 61 consecutive years, so Coca-Cola has earned a spot among the Dividend Kings. Income investors willing to tolerate underperformance in exchange for reliable dividend payments should feel comfortable buying this stock today.