With its shares down 25% over the previous five years, General Motors (GM -0.45%) has historically been a poor investment. This trend reflects investors' shift away from legacy, internal combustion-focused automakers to pure-play electric vehicle (EV) companies like Tesla, which has seen its stock rise a whopping 848% over the same time frame.

But market sentiment isn't GM's only problem. Near-term challenges with labor and profitability are mounting. And the company will have to work hard to ensure its next five years are brighter than its past. Let's dig deeper to find out if the company can pull this off.

Labor issues are resolved, but not over

On Oct. 30, General Motors reached a tentative agreement with the United Auto Workers (UAW) labor union, which will end the organization's six-week-long factory strike if accepted. The deal follows similar UAW agreements with Ford and Stellantis. It will involve an immediate pay increase, along with gradual cost-of-living raises over the next five years to max out at $84,000 annually.

For investors, this could be bad news. While GM hasn't yet mapped out the exact impacts expected from the new agreement, margins will almost certainly erode. Rival automaker Ford estimates that its UAW deal would add a whopping $850 to $900 in labor costs per vehicle it builds, and GM could be in a similar situation.

This development comes at a bad time. Legacy automakers are grappling with macroeconomic challenges like high interest rates (which reduce demand for cars) and an expensive transition to electric vehicles. Meanwhile, their biggest rival, Tesla, is non-unionized in the U.S. and plans to cut its production costs through manufacturing efficiency and robotics. Over the coming years, production costs look likely to be a major roadblock for GM -- possibly derailing its long-term competitiveness.

How are operational results?

GM's recently reported third-quarter earnings were a mixed bag. Revenue increased by a modest 5.4% year over year to $44.1 billion while adjusted earnings before interest and taxes (EBIT) declined 16.9% to $3.56 -- driven mainly by the performance of its traditional internal combustion engine (ICE) business. But over the long term, ICE sales will become a less important part of GM's business model as it pivots to electric vehicles and mobility technology.

Futuristic car driving through light.

Image source: Getty Images.

The transition is running into some challenges. While GM's EV sales increased 28% to $32,000, its self-driving subsidiary, Cruise, generated zero revenue in the quarter while losing a whopping $700 million as it spends on research and testing. And in late October, Cruise suspended all driverless operations in the U.S. after California regulators halted its permit following a series of accidents. This headwind calls Cruise's viability into question and could lead to higher costs as it works harder with regulators to regain compliance.

You get what you pay for

With a forward price-to-earnings (P/E) multiple of just 4.3, GM stock is almost comically cheap compared to the S&P 500 average of 24 -- as well as Tesla, which trades for 60 times projected earnings. The low price tag could make the stock attractive to value investors who want to benefit from dividends and share buybacks, which involve a company purchasing its own shares to increase investors' claim on future earnings.

That said, GM's profitability and cash flow aren't exactly safe. The automotive industry is notoriously volatile because of its sensitivity to macroeconomic conditions like interest rates and recession.

GM faces additional margin pressure because of its unionized workforce, which may drive up its production costs relative to its non-unionized competitors. New growth drivers like EVs and autonomous driving will likely make the situation worse before it gets better. With all that in mind, GM's shares look likely to underperform over the next five years.