The U.S. stock market roared to another big gain in 2021, despite the continued toll of the COVID-19 pandemic -- not to mention other potential pitfalls like supply-chain snarls and rising inflation. The S&P 500 surged 27%, on top of a 16% increase in 2020 and a 29% gain in 2019. For that three-year period, the closely watched index nearly doubled.

While strong fundamentals drove some of these gains, many stocks sit at lofty valuations entering 2022. The S&P 500 currently trades for more than 21 times forward earnings. That said, there are still some bargains available. Shares of General Motors (GM -0.17%) and SkyWest (SKYW 1.62%) appear particularly undervalued, offering investors substantial upside in 2022 and beyond.

General Motors set to gain momentum

GM stock jumped 41% in 2021, beating the broader market. However, it racked up its entire gain in the first half of the year before losing steam due to production cuts caused by the global semiconductor shortage and longer-term worries about whether it will navigate the transition to electric vehicles (EVs) successfully.

GM Chart

General Motors stock vs. S&P 500 performance for 2021, data by YCharts.

As a result, General Motors shares continue to trade at a rock-bottom valuation. In early December, GM raised its full-year guidance for 2021 adjusted operating income from $11.5 billion-$13.5 billion to $14 billion. Analysts now expect the company to post full-year adjusted earnings per share (EPS) of $6.78. GM stock trades for less than 10 times that EPS projection (which may still be too conservative).

GM is posting strong earnings despite slashing production (particularly in the second half of the year) due to the global chip shortage. The company expects semiconductor supply to improve over the course of 2022, enabling higher production. GM also recently increased its full-size truck production capacity by bringing a new assembly plant on line.

Meanwhile, the combination of pent-up demand and low dealer inventories entering the year should keep pricing high, benefiting the General's margins. Rising production and dealer inventory levels will also boost free cash flow, thanks to working-capital improvements. This strong near-term outlook could help GM stock rally again in 2022.

A dark-colored Chevy Silverado driving on a rural road.

Image source: General Motors.

Equally importantly, GM's investments in the future of the auto business are poised to pay off. New models built on GM's Ultium EV platform will arrive at a rapid pace starting this year. Its Cruise subsidiary has secured nearly all the permits needed to launch a robotaxi service in California. And its BrightDrop electric-delivery van business is taking off rapidly.

Last year, GM set long-term targets of growing revenue to between $275 billion and $315 billion by 2030, with a 12% to 14% operating margin. At the high end, that implies an annual operating profit of $44 billion. For comparison, GM's current market cap is just $91 billion. As investors gain confidence in these targets, GM stock could surge well into triple-digit territory.

SkyWest: The recovery will continue

Regional-airline SkyWest also appears massively undervalued entering 2022. Whereas most airlines posted huge losses in 2020, SkyWest essentially broke even, thanks to its fixed-fee business model. The company is on track to report a solid profit for 2021, too.

That said, analysts expect SkyWest to earn barely more than half of its 2019 adjusted EPS of $6.25 in 2021 and 2022. In the near term, the company faces significant headwinds from staffing shortages that have been magnified by the rapid spread of the omicron COVID-19 variant. SkyWest has made deep schedule cuts since Christmas, in response. This may explain why its stock surrendered all of its early 2021 gains by the end of last year.

SKYW Chart

SkyWest 2021 stock performance, data by YCharts.

However, SkyWest's fortunes will likely change for the better as 2022 progresses. First, the company has navigated the regional-airline pilot shortage more successfully than most of its peers. That puts it in prime position to snag high-margin flying contracts from its major airline partners in the future.

Second, air-travel demand will likely surge this spring after the current wave of the pandemic passes. Third, SkyWest has several new flying contracts coming on line in 2022 and early 2023, which will drive revenue growth.

These factors will likely get earnings growing again by the second half of 2022. By 2024, when all of its new contracts will have fully ramped up, SkyWest's earnings power should return to pre-pandemic levels.

Today, SkyWest stock trades for less than seven times the company's 2019 earnings. That points to 50%-plus upside potential for investors in 2022 if profitability trends back toward 2019 levels by year-end.