Yesterday, shareholders in chipmaker Advanced Micro Devices (AMD 4.04%) and defense contractor SAIC (NYSE: SAI) got what seemed like bad news. In the end, though, they might be the ones with the last laugh.

The two companies found out that they would get dropped from the S&P 500 index later this month. In their place, Vertex Pharmaceuticals (VRTX 0.05%) and Ametek (AME -0.91%) will rise to the large-cap benchmark, giving up their places in the S&P MidCap 400 index to AMD and SAIC.

At first glance, the move might seem like the kiss of death for the two demoted stocks. Indeed, in after-hours trading, Vertex climbed, while AMD fell sharply. What might surprise you, though, is that in the long run, it might be AMD and SAIC that get the last laugh. Later in the article, you'll find out why, but first, let's look at how these four companies got to where they are right now.

The rise and fall of S&P stocks
Unlike the Dow, which only rarely makes changes to its components, the S&P 500 regularly shifts stocks among its many index products. S&P Dow Jones Indexes, which oversees the S&P 500, said that, given the fact that Vertex and Ametek both have market capitalizations of more than $10 billion, it made sense to add them to the premier index. By contrast, AMD has a less than $3 billion market cap, and SAIC currently stands at $5 billion.

The two added stocks have both been strong performers in recent years, but they've taken very different paths to achieve their respective success. Ametek, which is a low-profile maker of electronic instrumentation and monitoring systems, has benefited greatly from its exposure to the aerospace industry. Making cockpit systems and sensor equipment for commercial aircraft, Ametek is well-placed to profit from the expected upsurge in aerospace sales over the coming decades.

Vertex, on the other hand, has maintained a high-profile image, with its treatments for cystic fibrosis and hepatitis C showing great promise to deliver future profits. Unlike Ametek's slow-but-steady rise, Vertex has tended to make great leaps higher in the wake of good news, with long periods of consolidation as investors weigh its prospects against those of its rivals in the increasingly competitive environment in the hep-C space.

Meanwhile, for the relegated stocks, different factors justified their exit. SAIC hasn't performed badly, but it expects to complete its long-planned breakup into two separate companies this month, breaking an already smallish S&P member into two even smaller parts.

For AMD, though, substantial losses reveal its inability to match up to its chip rivals in the PC and mobile spaces. The stock has actually soared this year when AMD got its chips included in the designs for two major game-console releases for the newest versions of the PlayStation and Xbox, but whether those wins will produce a lasting recovery, or merely provide a brief respite from the company's longer-term decline, remains to be seen.

Can AMD and SAIC win in the end?
Investors in AMD and SAIC shouldn't give up hope, though. Research from Wharton market historian and research professor Jeremy Siegel took a look at the key question of how stocks that get added to, or deleted from, the S&P 500 perform after their index moves. The surprising result was that, on average, the stocks that got kicked out of the S&P did better than those that got added.

Intuitively, that result makes a degree of sense. Vertex and Ametek have already experienced big share-price gains, making it more challenging for them to produce outpaced returns in the future. By contrast, companies that get deleted from the index often have posted terrible performance, and subsequent turnarounds can reverse their fortunes quickly.

Keep your eyes open
Obviously, Siegel's research findings don't make AMD and SAIC automatic buy candidates. But, after all the index-fund-related buying and selling is done, it'll be interesting to see whether Vertex and Ametek live up to their promise -- and whether AMD and SAIC will eventually find their way back into the S&P 500 at some point in the future.