August was a tough month for stocks -- unless you're talking about Apple (AAPL 0.51%), that is. The nation's second largest company by market capitalization outperformed the S&P 500 (^GSPC 0.87%) by an impressive 11.5%, ending the month behind only four other index components -- click here to see which stocks beat the storied iPhone maker last month.

AAPL Total Return Price Chart

To be fair, shares of Apple were primed for a superior performance. By the end of June, they had lost more than 40% from their September high of $705. They trade for 12 times earnings, which equates to a 31% discount to the S&P 500 overall. And they yield 2.5%, which beats the broader market's 2.12% yield by 18%.

On top of that, or perhaps because of it, the stock has recently caught the eye of at least one high-profile investor. Carl Icahn, the noted activist investor, announced earlier in the month that he had taken a $1.5 billion stake in the company. His thesis is simple: Apple is undervalued and has the resources to execute an even larger capital return than the $100 billion program announced in April.

"Buy the company here and even without earnings growth, we think it ought to be worth $625," Icahn said in an interview with The Wall Street Journal.

Just this past week, moreover, Icahn went to Twitter to announce that he and Apple CEO Tim Cook will be having dinner soon to discuss both the magnitude and timing of the company's buyback. And while some people are equating Icahn's move as a meddlesome analogy to his position in Dell, as my colleague Adam Levin-Weinberg noted, his "activism poses no credible danger at all."

It's worth observing here that Apple's performance last month wasn't wholly the result of external factors. In the first case, the rumors continue to circulate that a new product line is in the mix. On Wednesday, for example, the Apple blog AppleInsider reported that the Cupertino-based company "is rumored to be gearing up to partner with Inventec in 2014 to manufacture a massive 63.4 million smart watches priced at $199."

In addition, it's widely assumed that Apple has chosen Sept. 10 to announce the release of its latest iPhone, the 5S, in addition to a cheaper version, the 5C, that's presumably geared toward consumers in emerging markets. The hope is that the move puts Apple a step closer to locking up a deal with China Mobile, the world's largest mobile network which for now remains off-limits to Apple's wares.