As it did with most elements of our lives, the coronavirus pandemic had a withering effect on many stocks in 2020. Companies in more than a few sectors suddenly had to contend with stay-at-home orders and mandatory business closures, a challenging set of circumstances for which few were prepared.

Still, companies in certain segments of the economy in general fared better than others (yes, we're looking at you, tech). Some stocks, happily, fared much better than others. Here, three Motley Fool contributors reveal which of their portfolio holdings did the best in a very trying year -- namely Facebook (META -1.65%), StoneCo (STNE 0.56%) and Innovative Industrial Properties (IIPR 0.88%).

Woman in a winter landscape jumping triumphantly.

Image source: Getty Images.

A social giant in a time of isolation

Eric Volkman (Facebook): Far and away, my No. 1 was that old social media standby, Facebook, which as of mid-December had risen 39% year to date.

When the coronavirus hit and began infecting the stock market I didn't expect any of my titles to do well over the course of 2020. But in retrospect given the many advantages Facebook enjoys -- plus the fact that as an operator of websites and apps it's very pandemic-resistant -- I'm not surprised it outperformed.

Already a frequent destination either via PC or mobile device, Facebook's site was an ever more attractive e-forum with the lock-ins engendered by the pandemic. More visitors and traffic means more money; in its third quarter, the company's ad revenue increased 22% year over year, helping boost net profit by 29%. This set the stage for what management convincingly believes will be a very hot fourth quarter, on the back of robust holiday ad spending.

Facebook is the kind of company I really like being invested in. It's got a highly compelling and "sticky" product that keeps attracting new users. And while it's not the only social media game in town, its moat is wide enough to attract scores of repeat advertisers who pay good coin for highly targeted spots. While any online audience is fickle, people tend to stay on Facebook, and I don't see that changing anytime soon, if ever.

I'd say that's also the case for two pricey yet very worthwhile acquisitions the company made some time ago. Both Instagram and WhatsApp are go-to apps for photo sharing and messaging, respectively. The moats are also nice and wide for the pair (more so for Instagram), so they fit very well into Facebook's portfolio.

Given all these pluses, I can't envision myself selling this stock in the near future. The key financial and operational metrics for the company are still growing at double-digit rates; now more than ever, the world wants to stay connected and be entertained. I'm not only going to hang onto Facebook stock in 2021, I'll probably keep it in my clutches for many years past that.

A leader in a market that still has huge growth potential

Keith Noonan (StoneCo): Following the stock market crash in March and a bit of extra time to digest coronavirus-related risks, I started looking for potentially high-growth stocks that had been pushed down to discount levels. I got somewhat lucky because technology is the sector I know best, and focusing my search there as businesses rushed to digital channels helped me notch some tremendous winners in a volatile and challenging year. StoneCo has been my best performer by a significant margin. 

I started following the Brazilian fintech company shortly after its initial public offering in 2018 and continued to monitor its performance but held off on buying. StoneCo got crushed during the worst of the coronavirus-driven sell-off, and I saw an opportunity to buy a potentially explosive stock at a substantial discount. As of this writing, my total investment in the company is up roughly 190% -- a stellar performance that I don't expect to repeat with any regularity. 

I really liked StoneCo's chances of building and maintaining a leading position in Brazil's fast-growing payment processing market and its opportunities to expand its footprint in other Latin American markets. However, I also didn't expect it to be my top performer this year and made bigger bets on more than a handful of other stocks.

While I'm thrilled with how it's performed so far, there are also pangs of regret that I didn't put more funds into the fintech stock instead of spreading the money around over some growth bets that delivered less flashy performance. On the other hand, the fact that I didn't expect StoneCo to be my biggest winner also speaks to the value of taking a diversified approach, even when prioritizing growth or focusing on a particular market sector. 

The company now has a valuation of roughly $25 billion, which is more than twice its market cap at the start of the year, and that naturally raises the question of whether it's time to take profits. Despite the stock's stellar run, I'm in no hurry to sell my shares. I haven't added to my position since June, but I think the stock still offers upside for long-term investors at current prices. Payment-processing and other fintech services are still on track for huge growth in Brazil and other Latin American markets thanks to the rise of e-commerce and convenient mobile applications, and StoneCo still provides market-leading solutions.

Backing category leaders in young and rapidly expanding markets can be a path to fantastic returns, and I'll continue devoting a substantial portion of my portfolio to that strategy in 2021 and beyond. 

Reaching a high with cannabis

Barbara Eisner Bayer (Innovative Industrial Properties): I'm closer to retirement than many of my colleagues, so I like to play things a little safer by holding on to my long-term winners and not necessarily shooting for the newbie investing stars any longer. However, when I found a company that fit in nicely with my goals of capital preservation with a healthy dividend, I took a bite out of the company that turned out to be my biggest winner of 2020: Innovative Industrial Properties, a real estate investment trust (REIT) in the cannabis industry that was up 119.5% for 2020 (as of Dec. 11).

As a child of the Woodstock generation and longtime resident of that town in upstate New York, I've been interested in an investment in marijuana for a long time. But pot isn't legal at the federal level, which makes investing in the cannabis sector a challenging proposition.

But IIPR changed my mind. Innovative doesn't buy or sell marijuana. Instead, it purchases properties from operators in the pot industry and leases them back to the same operators. This has been a lifesaver for these companies as it provides them with cash, which is sorely needed until cannabis becomes legalized nationally.

Over the last three years, Innovative's trailing-12-month revenue was up more than 1,400% and earnings have delivered a mouth-watering 3,600% return during the period. So I guess it's not all that shocking that it came out on top of my portfolio. And the industry itself is gaining steam: Several states voted to legalize both recreational and medical marijuana on Election Day, and now, it's legally available in some form in 36 states.

And what about that dividend? REITs are required by law to return 90% of their taxable income as dividends to their shareholders. Innovative's is currently north of 3%, which may be small for a REIT. But considering the company's growth prospects -- it's on track to double the number of properties it owns in just 3 1/2 years -- it feels a lot larger.

I was somewhat surprised to see that IIPR was my biggest winner and beat my other racehorse Amazon.com by a nose. I plan to hold onto this fantastic company well into retirement, while I keep my eye on the price, and will scoop up more shares if a buying opportunity presents itself.