Since Apple's (AAPL 1.27%) last earnings report, shares of the iPhone-maker have rallied more than 25%, absolutely crushing the broader market and far outperforming its smartphone rival, Samsung (NASDAQOTH: SSNLF).

AAPL Chart

AAPL data by YCharts

Apple will reveal its third quarter earnings on Tuesday, after the market closes. Ahead of that release, it's worth noting the combination of factors that have allowed the tech giant to notch such impressive gains.

Hope (and hype) for the iPhone 6
Apple's multiple has expanded since its last earnings report -- in mid-April, Apple was trading with a price-to-earnings ratio around 12.50. Today, it's more than 15.7. To a great extent, that multiple expansion appears to have been predicated on hope that Apple's next smartphone will impress consumers.

AAPL PE Ratio (TTM) Chart

AAPL P/E Ratio (TTM) data by YCharts

Numerous reputable media outlets have reported that Apple's next iPhone will ship with a larger screen -- and though it remains unconfirmed, investors and analysts appear to have taken it as fact. Supply chain leaks have put the screen at 4.7 inches, which wouldn't be as large as Samsung's 5.1-inch Galaxy S5, but may be enough to win over some of Samsung's customers. At the same time, it may keep Apple's current customers from switching to a Samsung phone when it comes time to upgrade.

Several analysts have boosted their rating on Apple shares this quarter, or raised their price target, on the belief that Apple's next iPhone will be its best-selling model ever.

Raymond James, for example, raised its price target on Apple back in June, citing what is likely to be a strong iPhone 6 upgrade cycle. Just a few days later, analysts at Cowen followed suit, arguing that Apple had enough components to build some 100 million iPhone 6 by the end of the year.

Earlier this month, Barclays raised its rating on Apple to overweight. In addition to strong iPhone demand, Barclays saw Samsung's recent weakness as an opportunity for Apple. JMP Securities raised its rating on Apple to outperform on Monday.

An unorthodox stock-split
At the same time, investors may have been operating under the belief that Apple's unorthodox seven-for-one stock split would bring in a new, broader base of shareholders. Yet, I say "belief" because most of Apple's recent gain has come prior to its June 9 stock split. Ahead of that split, investors may have bought in, believing in a forthcoming rally. But since then, shares of Apple have gained less than 2% -- better than the S&P 500.

AAPL Chart

AAPL data by YCharts

Nevertheless, in time, the split could add to Apple's share price. The Wall Street Journal noted that, since 2010, companies that have split their stocks have tended to perform well in the months that followed.

A commitment to return capital
Lastly, and perhaps most significantly, has been Apple's commitment to return cash to shareholders. Investors, including hedge fund managers David Einhorn and Carl Icahn, have pushed Apple to do something with its tremendous cash pile in recent months.

In April, Apple boosted its share repurchase program by 50%, raising it to $90 billion. At the same time, Apple also raised its dividend, and pledged to increase it on an annual basis -- effectively ending the debate over its capital return policy. Although some investors may have feared that a commitment to extensive capital returns would signal an end of Apple's growth phase, having an excessively large balance sheet wasn't helping the company either, and may have even weighed on Apple's multiple. Einhorn argued last year that an aggressive capital allocation program could add more than $100 to Apple's share price (then trading around $450). On an adjusted basis, since Apple's latest earnings report, shares have rallied more than $130.