Tesla (TSLA -0.41%) is due to report its financial results for the second quarter of 2023 (ended June 30) on July 19. However, as always, it released its quarterly electric vehicle production and customer delivery numbers ahead of time.

Both figures were at record highs, suggesting that the company's recent price cuts are having a positive impact on demand.

Selling a higher volume of cars at a lower profit margin is a strategic move by CEO Elon Musk, not only to fend off growing competition in the electric vehicle industry, but also because it creates an even bigger long-term opportunity for the company. Here's why.

A black Tesla car driving on an open road with a snowy landscape in the background.

Image source: Tesla.

Tesla delivered a record number of cars in Q2

Consumers have struggled under the pressure of high inflation and rising interest rates over the past year, and that's having a direct impact on the demand for big-ticket purchases like cars. As a result, Tesla has been trimming the price of its electric vehicles in 2023 to bring new buyers into the fold.

There's clear evidence it's working; the company delivered 422,875 cars to customers in the first quarter, which was a 36% year-over-year increase. And the freshly released Q2 figure was 466,140, marking a whopping 83% jump compared to the year-ago period -- a massive growth acceleration.

Of course, slashing prices to sell more vehicles comes at a cost. In Q1, Tesla's industry-leading gross profit margin fell to 19.3%, far below the year-ago figure of 29.1%. It was still much higher than the overall 15% gross margin of Ford, for example, but we won't know Tesla's most recent second-quarter result until July 19.

However, the margin Tesla earns by manufacturing and selling each vehicle might not matter in the long term. Why? Because the company is a leading developer of fully autonomous self-driving software, which could be released to the public later this year. Musk says the average passenger vehicle spends just 12 hours per week on the road, so by installing self-driving software, it could become a robotaxi and operate within an autonomous ride-hailing network.

The vehicle would earn revenue that would be split between its owner and Tesla, creating a brand-new industry that Cathie Wood's Ark Investment Management says could generate $4 trillion in revenue in the next five years. Musk says autonomous robotaxis could transform Tesla's economics, increasing its gross margin to over 70% in the long run because each car would potentially earn money for the company in perpetuity. As a result, Musk wants as many Tesla vehicles on the road as possible, even if it means sacrificing short-term profits from each sale.

Why Tesla stock is a buy now

Tesla stock is on a tear in 2023 with a 159% gain so far, but it's still down 31% from its all-time high following the dramatic sell-off in the technology sector last year. It appears relatively expensive based on traditional valuation metrics like the price-to-earnings (P/E) ratio; the company has generated $3.85 in earnings per share over the last four quarters, which gives the stock a P/E of 72.8.

That's more than twice as expensive as Tesla's peers in the technology sector, represented by the Nasdaq-100 index, which trades at an average P/E of 31.1. But the stock market is a forward-looking machine, and Tesla's future potential is the reason investors are willing to pay a premium. 

For example, Tesla has told investors it expects to produce 1.8 million cars in 2023, but it has already made more than 920,000 in the first half, which puts it on track to beat that figure. That's prompting investors to reconsider their forecasts, which is why the stock jumped 7% immediately following its Q2 production and deliveries news. Plus, the company intends to dramatically increase production going forward by operating as many as 12 Gigafactories around the world by 2030 (up from just four today). That would presumably give Tesla the capacity to make 20 million cars per year. 

But, as mentioned above, the real profit potential will likely come from its self-driving software and the creation of a ride-hailing network. The more cars Tesla gets on the road now, the more money it stands to make in the future, so the whopping 83% increase in Q2 deliveries could have a compounding effect on the company's financials in the long run.

As a result, it's unlikely Tesla stock will remain 31% below its all-time high for much longer. However, investors who do buy it now should plan to hold on for at least five years to maximize the probability of earning a positive return.