It has been a great year for the stock prices of some very well-known companies, and in a few cases surprisingly so.

The broader market's performance hasn't been too shabby, either. So far on the year, the S&P 500 (^GSPC) has rallied 16% — with an 8.5% gain alone in the second quarter. The 40 best-performing stocks in the S&P 500 have notched a median gain of 60.4%, according to data from Goldman Sachs (GS).

Such double-digit appreciation on the S&P 500 comes despite several formidable headwinds swirling around, ranging from the Archegos Capital Management blowup in the winter to threats of higher taxes from the Biden administration to a clear change in tone on monetary policy from the Federal Reserve. 

The top three best-performing sectors of the S&P 500 include energy (+45%), financials (+25%) and real estate (+24%).  

Underneath the hood of the S&P 500, there have been a host of eye-popping gains as seen below in a new chart out of Goldman Sachs. 

In the not-so-surprising category, there are 69.1% and 49.1% respective increases in the stock prices of Ford (F) and General Motors (GM). Both auto giants have benefited from strong pricing power amid vehicle shortages brought on by the yawning semiconductor shortage. Each has also been praised by Wall Street for aggressive pushes into electric vehicles as they look to challenge EV leader Tesla (TSLA). 

The 53.3% surge in shares of Nvidia also looks to be rather deserved. Analysts have clung onto the chip-maker's stock this year amid strong results for its gaming chips and crypto mining exposure. The impending $40 billion deal for Arm is also seen as a game-changer for the company's future earnings power.

Not too shabby of year for the stock prices of many companies.

As for the surprises in the market, there are several that standout.

For starters, Gap's shares have shot up a mind-bending 68% year to date on optimism over Kanye West's new apparel collection for the retailer and people buying clothes en masse for their post-pandemic lives. But, the company is still seen as a longer term market share loser by most Wall Street analysts. 

Story continues

Out of the 21 sell-side analysts that cover Gap, only four rate the stock a Buy, according to Bloomberg data. A total of 14 analysts rate the stock a hold, with one coming in at a sell.

Wells Fargo (WFC) shares are shockingly up 50.8% this year as new CEO Charlie Scharf struggles to stabilize the company after its highly publicized account fraud scandal. The bank is generally viewed on the Street as not as fundamentally sound as rivals JPMorgan (JPM) and Bank of America (BAC). 

Meanwhile, five of the top 10 best-performing stocks in the S&P 500 this year are energy companies. While the names appear to be tracking the 45% rise in oil prices this year, the gains are somewhat surprising given the increased ESG focus among institutional investors. ExxonMobil is interestingly up 57.9% this year even as it battles through a board shakeup, a bloated cost structure and questions about the leadership of its CEO Darren Woods.

Whether the S&P 500 could continue its blistering pace evidenced in the first half is anyone's guess. The aforementioned headwinds to stock prices are unlikely going anywhere, and in fact could blow harder, some analysts say.

"You've got two big headwinds facing the market in the next six months that I think is likely to restrain the appreciation. The first issue is higher rates [interest]. The idea of higher rates is typically associated with some lower valuations," Goldman Sachs chief U.S. equity strategist David Kostin said on Yahoo Finance Live.

Kostin says the other issue facing investors comes at the hands of lawmakers.

"The second issue is tax reform. We are sitting here today literally in the middle of the year and that is likely to be the dominant topic policy-wise in the next several months in Congress as they negotiate both the potential for higher corporate tax rates and the potential for higher capital gains rates," Kostin added.

Kostin's 2021 price target for the S&P 500 is 4,300, a shade below its current level of 4,352.

Brian Sozzi is an editor-at-large and anchor at Yahoo Finance. Follow Sozzi on Twitter @BrianSozzi and on LinkedIn.

What’s hot from Sozzi:

  • AMD CEO: the semiconductor shortage will take time to correct

  • Kansas City Chiefs phenom Patrick Mahomes: I am trying to build a business empire

  • Foot Locker CEO: this is what our future holds

  • Intel CEO: here is when the chip shortage may end

  • Coca-Cola CEO: our business is rounding the corner from the pandemic

  • PGA Tour star Rickie Fowler: why I am bullish on this new $40 million bonus pool

Watch Yahoo Finance’s live programming on Verizon FIOS channel 604, Apple TV, Amazon Fire TV, Roku, Samsung TV, Pluto TV, and YouTube. Online catch Yahoo Finance on Twitter, Facebook, Instagram, Flipboard, SmartNews, and LinkedIn.

(305) 707 0888