Tesla (TSLA -0.02%) stock peaked back in 2021, but the electric vehicle (EV) disrupter is still one of the best-performing stocks on the market over the last five years.

Shares surged in 2020 as Tesla proved it could be viable, turning a profit and making it clear that EVs were the way of the future. As a result, the rest of the auto industry has been playing catch-up since.

Tesla now has a market capitalization of roughly $750 billion, trouncing every other automaker, but there's trouble in EV paradise. Tesla's revenue growth slowed to just 9% in its recent quarter with automotive revenue up just 5%. Production growth has moderated, and price cuts led to declining profits year over year in the third quarter. The EV maker's once-vaunted operating margins went from 17.2% in the quarter a year ago to just 7.6%, and operating income fell by more than half to $1.76 billion.

In addition to Tesla's own challenges, there are signs of broader weakness in the EV industry as demand seems to be fading, inventory is piling up, production is getting delayed, and the industry is receiving pushback from dealers and auto workers.

Despite those concerns, Tesla still trades at a premium valuation, currently priced at a price-to-earnings ratio of 75. That price tag seems to reflect investor confidence that Tesla will lead the next revolution in the auto industry: AI and autonomous vehicles. The company's Full Self-Driving technology is in beta, and investors and Tesla owners have been awaiting the green light on the new technology for years. Tesla is also developing an autonomous robot called Optimus.

At its current valuation and with revenue growth slowing, the stock carries a lot of risk. It's essentially priced for perfection, and production delays and increasing competition are likely to eat into the stock price. Even CEO Elon Musk seemed to lose his swagger on last month's earnings call, complaining about interest rates, challenges with Cybertruck production, and saying that the company would be strategic about the opening of its plant in Mexico due to the current macroeconomic challenges.

A Tesla Model 3 on a wintry road.

Image source: Tesla.

A better alternative

For investors, there's a better alternative to Tesla stock right now, and it trades at a much more attractive valuation.

That's General Motors (GM -1.28%). The legacy automaker is generating robust profits and has a strong foothold in both electric vehicles and autonomous vehicles through its Cruise AV division. Meanwhile, the legacy automaker is trading at a dirt cheap valuation because investors seem to regard gas-powered vehicles as a relic. But that should provide a valuable profit stream for the company for years to come, especially as there's evidence that demand for EVs seems to be slowing.

In its third quarter, GM posted an operating margin of 8.1%, ahead of Tesla's third-quarter result, and its revenue growth was 5.4%, similar to Tesla's automotive revenue growth.

While GM said it would slow its EV ramp due to industry-wide demand issues, it still aims to have the capacity to produce 1 million EVs by the end of 2025, not far behind where Tesla is today, which is on track to produce 1.8 million EVs this year. In the third quarter, GM's electric vehicle sales increased by 28%, easily outpacing Tesla as well, and GM produced 32,000 EVs in the quarter. The Chevrolet parent is also targeting low- to mid-single-digit operating margins in EVs by 2025.

GM's Cruise division has run into a roadblock in San Francisco, which ordered its cars off the road after an accident. As a result, Cruise has taken roughly 400 driverless ride-sharing vehicles off the road nationally as it regroups and reviews its technology and strategy. However, Cruise is essentially in a two-way race with Alphabet's Waymo at this point, while Tesla has yet to make money from a driverless ride. Assuming the current setback is just temporary, Cruise still has a lot of potential over the long term.

Altogether, GM has a highly profitable legacy auto business and looks to be well positioned in EVs and autonomous vehicles. However, the stock trades at a price-to-earnings ratio of less than 4, a bargain-basement valuation normally reserved for failing companies. GM, on the other hand, is highly profitable, and compared to Tesla, investors are pricing in much slower growth.

GM's valuation makes it easy for the stock to move higher from here, while Tesla's seems to set it up for a fall. Given the weakness in the EV market and GM's core profits, the legacy automaker is the better stock to buy here.