Many investors shy away from mid-cap stocks in favor of larger, more established companies. For them, buying shares of well-known businesses provides a sense of safety. After all, how likely is it that a company worth hundreds of billions of dollars will go out of business? This aversion to taking risk makes sense for those who place a premium on not losing money.

On the other side of the equation from risk is return. Mid-cap stocks have historically outperformed large caps since 1972, posting an average annual gain of 15.3% compared to 13.2% for large caps. As the U.S. economy tries to get back to the economic output of 2019, mid-cap stocks could offer an outsized opportunity for gains. Below are three of my favorites.

Growing companies.

Image source: Getty Images.

Trex

The share of new homes with decks has held steady since the housing crisis of 2008 at around 23%. While wood has long been the standard building material for creating these outdoor spaces, Trex (TREX 1.38%) has combined the desire for outdoor living space with environmental consciousness to offer premium decking made from 95% recycled content. The company has garnered 20% of the residential decking market share and achieved 13.9% compounded annual sales since 2015.

Unlike with some higher-profile stocks, sales growth isn't the only thing going for Trex. The company has no debt, and management has improved operating margins from less than 1% in 2011 to 25% in 2019. With housing trends showing robust demand and outdoor living space -- a safer way to gather with friends and family -- at a premium, the maker of decking, fencing, lighting, and railings is in prime position to continue profiting from the hot housing market and more environmentally conscious consumers.

Five Below

The dollar-store concept has been a success in the past decade. In the decade after the 2008 recession, the number of locations for the three major chains -- Dollar General, Dollar Tree, and Family Dollar -- grew by 62%. While these stores mostly focus on lower-income shoppers, Five Below (FIVE -3.13%) turns the model on its head, targeting young people and women with a fun atmosphere and a treasure-hunt model with everything from specialty products like exclusive gaming gear to headphones, sunglasses, yoga mats, and laundry detergent. Despite the store's name, management has raised prices on some tech products to offset tariffs on goods imported from China.

The model has worked. Management plans to triple its store base, which is currently about 1,000, and sales have grown 22% annually since 2013. Remarkably, new stores pay back the investment in less than one year, and the company carries no debt. Despite responding to the pandemic by closing all of its stores in mid-March, management reported 90% had been reopened by mid-June.

For the most part, management is working to put the pandemic behind them. Sales for the quarter ending Aug. 1 were up 2.1% compared to 2019 -- 6% for reopened stores -- and management opened 62 net new stores. After seeing Five Below survive a total shutdown and continue to grow sales and store count in the most recent quarter, investors should "let go and have fun" -- the store motto -- buying shares in this superior concept. Although continuing COVID-19 cases could lead to local shutdowns, management has proven they can adjust to temporary disruptions to keep growing sales and stores. 

Proto Labs

Under pressure from a trade war with China, U.S. factory activity shrank in August 2019 for the first time in a decade. This grim data was followed by a slight dip in February and record low in March of this year. Given those statistics, it might seem odd to recommend buying shares in a manufacturing company, but Proto Labs (PRLB 0.04%) is no ordinary manufacturer. The company operates a unique service of high-mix, low-volume production for prototypes and parts that would otherwise require capital investments by Proto Labs' customers. The company does this through automated quoting software for traditional approaches like injection molding, machining, and fabrication, as well as nontraditional methods like 3D printing.

Although the hype around 3D printing has faded, the market for the technology is expected to grow more than 26% per year to $1 billion in 2024. Although sales have slowed from 29% in 2018 to a paltry 3% last year, the company has no debt and counts 48,000 developers using its software tool. That number has grown from only 16,000 in 2013. These users typically need the company's services to try out new designs and keep jobs on track when a part fails.

The value to the user is substantial. The automated software provides feedback on cost efficiency and ease of manufacturability while providing interactive quotes in as little as 24 hours. Despite being a manufacturer, the service functions similar to the way Amazon Web Services allows software providers to scale their product depending on usage. In a world becoming more automated every year, Proto Labs' automated quoting, value-added design feedback, and 3D printing capability deserve a place in investors' portfolios.