2017 was a great year for the stock market, with the Dow Jones Industrials posting gains of more than 25% and the broader-based S&P 500 scoring a 20% rise. Yet those gains paled in comparison to the massive returns that the 10 best stocks in 2017 managed to post. All 10 of the top stocks in the Russell 3000 Index of large, mid-sized, and small companies quadrupled or more in value last year, and as you'll see, nearly all of them came from a single niche of the market.

Here are the 10 biggest winners of 2017

Stock

Market Cap

2017 Return

Madrigal Pharmaceuticals (MDGL -3.15%)

$1.37 billion

516%

Sangamo Therapeutics (SGMO -5.92%)

$1.51 billion

438%

Pieris Pharmaceuticals (PIRS -5.11%)

$333 million

437%

Straight Path Communications (NYSEMKT: STRP)

$2.33 billion

436%

Esperion Therapeutics (ESPR 10.53%)

$1.75 billion

426%

Ignyta (NASDAQ: RXDX)

$1.82 billion

404%

Nektar Therapeutics (NKTR -2.14%)

$9.19 billion

387%

Dynavax Technologies (DVAX 5.00%)

$1.09 billion

373%

Immunomedics (IMMU)

$2.53 billion

340%

Spectrum Pharmaceuticals (SPPI)

$1.81 billion

328%

Data source: S&P Capital IQ. Includes only Russell 3000 index components.

The return of biotech

Nine of the top 10 stocks in 2017 were in the biotechnology industry. That makes sense, since the biotech niche was one of the best performers of the year in general. One biotech ETF posted gains of 43% last year, and even some of the biggest players in the field participated fully in the sector's rally.

Plenty of catalysts lifted these stocks in particular:

  • Madrigal benefited from positive mid-stage trial results for its treatment for non-alcoholic steatohepatitis.
  • Sangamo announced a key collaboration agreement with a major pharma player.
  • Esperion rose on good trial results for its cholesterol reducing drug candidate.
  • Ignyta got a buyout offer from a global giant in the industry.
  • Nektar saw good news in treatments in the painkiller and immuno-oncology space.
  • Dynavax got FDA approval for its hepatitis B vaccine.
  • Immunomedics saw good results from its breast cancer treatment sacituzumab govitecan in phase 2 trials.
  • Spectrum climbed after good interim results in a mid-stage trial of lung cancer treatment poziotinib.

Countless other biotechs enjoyed similar good news with their treatments, but larger companies saw smaller percentage gains due mostly to their greater size.

Needle poking into a cell, viewed under magnification.

Image source: Getty Images.

Yet you need to take 2017's gains in these stocks with a grain of salt, because the explosive returns that they posted last year came only after most of them suffered significant losses the previous year. Biotech struggled in 2016, and seven of the nine biotechs listed above saw their share prices decline by at least 25% that year. Dynavax was the big loser, plunging 83%, and that means that investors who bought into the stock at the end of 2015 are still down on their initial investment despite the stock's huge rebound last year. Sangamo and Ignyta were both down more than 60% in 2016, although the 2017 bounce has given their long-term shareholders solid gains.

The real lessons to learn from these winners

The more important thing about these winning stocks is what they all have in common. First and foremost, you can see that nearly all of them started out the year as true small-cap stocks, with only Nektar having a mid-cap market capitalization before its extensive gains for the year. Although 2017 was noteworthy for seeing some large-cap names put up impressive returns, the truly massive gains were reserved for smaller companies with explosive growth potential.

Investors should also recognize that the merger and acquisition environment can make a huge difference to returns among top stocks. The only non-biotech, Straight Path, is a great case in point, as the owner of wireless spectrum assets found itself in the right place at the right time when major players in the wireless telecom industry got into an exciting bidding war for the company. Investors now hope that they'll end up with a huge amount of Verizon stock once their planned acquisition closes. Being aware of the likelihood of M&A can be extremely useful, especially among the small-cap stocks that often become targets for much larger players in their respective industries.

Finally, it's often valuable to look at losing stocks to see whether their losses are justified. Often, out-of-favor industries turn into favorites in future years, and biotech in 2016 and 2017 is just one example of that phenomenon playing out in various sectors of the market.

Find 2018's winners

These 10 companies probably won't be on this list in 2018, because other smaller companies will have taken their place. But by being aware of the broader trends in exciting growth industries, you can scope out the areas that are most likely to see similar gains in the future and then work to narrow down the possibilities in those industries to gather the cream of the crop for your portfolio.