With a market cap near $720 billion, Apple (NASDAQ:AAPL) is currently the world's largest company. As a stock, its size makes it a massive component of the S&P 500 -- it represents about 4% of the index -- one of the largest weights in the index's history.

But not the largest: other firms have been bigger.

One of those firms is ExxonMobil (NYSE:XOM). In the first quarter of 2009, the oil giant briefly approached the 5% mark, before eventually crashing back. ExxonMobil is still an enormous company -- one of the largest in the market -- but the stock has performed poorly since then. What happened, and should Apple investors be concerned?

A flight to safety
ExxonMobil's status as the S&P 500's largest component was fueled as much by market turmoil as it was by radical business success. From the beginning of 2007 to the end of the first quarter in 2009, the S&P 500 lost more than 42% of its value -- ExxonMobil, meanwhile, lost only about 5%.

^SPX data by YCharts

ExxonMobil wasn't entirely insulated from the shocks ravaging the global economy, but its core business model -- supplying crude oil -- made it attractive at a time when the future of the global economy appeared incredibly bleak. At the same time, it was earning billions. In January of 2009, it posted an annual profit of $45.22 billion: the largest in U.S. history. The sharp rise in oil prices in 2007 and 2008 proved to be immensely beneficial to ExxonMobil.

Moving away from oil
Unfortunately, things have been quite different since then. If you invested in ExxonMobil in the second quarter of 2009, you certainly haven't lost your shirt, but you've definitely underperformed the broader market.

^SPX data by YCharts

Including dividends, shares of ExxonMobil have returned about 40% since then -- a fair amount -- but the S&P 500 gained more than 150% in the same time period. The factors that worked in ExxonMobil's favor have completely reversed: the global economy appears to be in much better shape today, while oil prices have come down significantly from their 2008 peak.

There's also growing concern about the future of the oil business, and some smart investors are getting out of the way. In February, Warren Buffett's Berkshire Hathaway disclosed that it sold its $3.7 billion stake in ExxonMobil. In an interview with CNBC, Buffett praised the company, but said he had other uses for the money. He also noted that the recent decline in the price of oil was eating away at ExxonMobil's earnings power.

Could Apple become the next ExxonMobil?
Other than their size, ExxonMobil and Apple are two very different companies, and the factors that contributed to ExxonMobil's rise and subsequent fall as the largest member of the S&P 500 don't appear to apply to Apple. Apple's place as the S&P 500's biggest component comes at a time when markets are near all-time highs. Its surge has been the byproduct of a strong business model. Demand for its high-margin iPhones has led to record quarterly profits.

Yet, its place at the top of the index may still be troubling. Earlier this month, DoubleLine's Jeff Gundlach noted that owning the largest company in the S&P 500 has never been a smart investment. Since 1972, the index's largest component has consistently under-performed it on a total return basis (via Business Insider).

That may be more of a technical argument than a fundamental one, but past a certain point, it becomes difficult for enormous companies to keep growing. Apple could be the first company to break the trend, but it's a risk factor definitely worth keeping in mind.

Sam Mattera has no position in any stocks mentioned. The Motley Fool recommends Apple and Berkshire Hathaway. The Motley Fool owns shares of Apple, Berkshire Hathaway, and ExxonMobil. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.