Generally, stocks that have fallen out of favor with the market are cheap for a reason. But, on occasion, savvy investors can scoop up a stock on the cheap and enjoy solid returns when the company proves its doubters wrong. It's not easy to discern which stocks fall into the pessimistically undervalued category, but here are two to consider: Hostess (TWNK), which is expanding and adapting its portfolio of snacks to drive growth, and General Motors (GM 1.20%) which could potentially strike gold thanks to its 2016 Cruise Automation acquisition.

Snacking is still a thing

Hostess has shed roughly 11% of its value over the past 12 months, a period during which it has dealt with a CEO transition and a growing recognition among investors that the trends in the U.S. point toward a preference for healthier snacks. Its shares are currently trading at a paltry price-to-earnings ratio of 6x. And while Americans are certainly choosing to eat healthier these days, Hostess can expand its portfolio of snack foods to drive growth and earn a higher multiple from Wall Street down the road.

A handful of snack cakes with cream filling on a plate.

Image source: Getty Images.

One perfect example was Hostess' acquisition of specific breakfast assets of Zurich-based food business Aryzta -- the Big Texas and Cloverhill brands, and a major baking facility in Chicago. The move will add key products such as honey buns, danishes and cinnamon rolls to its growing breakfast food segment. The brands will also bolster its access to club, vending, cash and carry, independent convenience store channels, and broaden its participation in multiple distribution outlets -- all things management believes will drive value in the coming years.

There's also evidence that Hostess has some momentum after a better-than-expected fourth-quarter of 2017 that sent its stock higher, and a strong first-quarter 2018. In Q1, net revenue jumped 13.1%, and excluding the Chicago bakery, net revenue increased 5.2%. Also, point of sale for its top seven sub-brands, which generate almost 70% of net revenue, increased 8.5% compared to the prior year. Hostess brand's market share at the end of Q1 was up 124 basis points to 17.9%, a record high since the company's relaunch in 2013.

While Americans are snacking healthier, there will always be demand for sweet pastries, and Hostess has brands that consistently drive higher pricing than its competitors -- its snacks sell at an 80% premium to Little Debbie's products, and 30% higher than the average price in the sweet baked goods segment, according to Morningstar.com. With its renewed focus on expanding its product line and getting its snacks into more stores, as well as its strategy of growth through smart acquisitions, Hostess could prove its doubters wrong in the years ahead. 

A huge step forward

Ever since the Great Recession, the entire automotive industry has been trying to convince investors that its business model was transforming. Despite these attempts, which featured a plethora of smart mobility and transportation projects, Wall Street wasn't listening -- and automakers were trading at paltry earnings multiples in the single digits.

But late last month, something major happened: Softbank Group's (SFTBF -0.02%) Vision Fund, which is known for its technology investments, agreed to invest $2.25 billion into GM Cruise, the automaker's self-driving subsidiary. That values GM Cruise at a whopping $11.5 billion, and gives a serious boost to GM's self-driving credibility. It also shows that dinosaur-like automakers can evolve into something more.

One question many investors have asked themselves for years is why GM never created a service such as Uber, which was valued at $72 billion as recently as February? That's insane compared to GM's $57 billion market capitalization, and could have changed how investors viewed GM's stock overnight.

Those investors are about to get what they want: GM Cruise is set to launch its driverless taxi service in 2019. We'll have to wait and see just how aggressive the automaker's plans for that subsidiary are, and how lucrative it might become. But while GM is taking a giant leap forward with its driverless ambitions, it's also transforming its core business more than many onlookers realize.

Image of 2019 Chevrolet Silverado parked off-road.

Chevy's 2019 Silverado. Image source: General Motors.

Consider that after decades of losing money in Europe, GM finally sold its Europe operations. It's reducing investments in its North American passenger car portfolio, and getting choosier about which emerging markets to participate in. On the flip side, as it pulls back from less profitable markets and segments, it's doubling down on North American trucks and SUVs, which will help margins; driving strong growth with Cadillac in China; and improving its commercial vehicle business.

Overall, GM is transforming itself to focus on the most profitable parts of its core manufacturing business, while also developing driverless vehicle technology and transportation-as-a-service projects. If it executes on those strategies (easier said than done), GM will evolve into something that is as much a technology company as it is a manufacturing company. And for a tech company, GM's price-to-forward-earnings multiple of 6 looks very cheap.

Both Hostess and GM face real challenges in the form of changing trends and evolving industries, and both could fall short in their efforts to transform rapidly enough to overcome them. But both have taken smart steps to become more competitive -- they just might pull it off and reward investors down the road.