Investors have recently become very enthusiastic about electric vehicle companies. Thanks to vast improvements in battery technology over the past decade, EVs are now getting closer to cost parity with gas-powered internal combustion engines. When you combine that with concerns over global warming and the trend toward ESG investing, the growth prospects for EVs, which only have a 2.8% share of new vehicle sales today, seem bright indeed.

But before you invest in any of the EV companies out there -- many of which are now going public to raise money at favorable valuations -- heed Warren Buffett's 1999 warning about investing in growth industries. He gave the warning during the 1999 Berkshire Hathaway (BRK.A -0.73%) (BRK.B -0.81%) annual meeting on the eve of the dot-com bust, but the concept still applies today.

A picture of Warren Buffett.

Buffett is generally not a fan of the auto industry. Image source: The Motley Fool.

Remember autos and airlines

All-electric vehicles are the revolutionary transportation innovation of the early 21st century, just like the internal combustion engine tantalized investors at the beginning of the 20th century. Imagine being an informed investor in the late 1800s and getting an early look at the first automobiles. No doubt, many would have invested in an invention that was sure to make early investors' fortunes.

The same could also be said of airlines. Obviously, the airplane was going to revolutionize travel and change society forever going forward. So it must have been a promising investment too, right?

A "difference between making money and spotting a wonderful industry"

In 1999, Warren Buffett and partner Charlie Munger were asked about potentially investing in internet communications stocks, which skyrocketed after the spread of the internet in the early 1990s. Berkshire hadn't touched them, meaning Buffett was missing out on a market that was booming at the time.

In response, Buffet said:

You know, the two most important industries in the first half of this century in the United States—in the world, probably—were the auto industry and the airplane industry. Here you had these two discoveries, both in the first decade—essentially in the first decade—of the century. And if you'd foreseen, in 1905 or thereabouts, what the auto would do to the world, let alone this country, or what the airplane would do, you might have thought that it was a great way to get rich. But very, very few people got rich by being—by riding the back of that auto industry. And probably even fewer got rich by participating in the airline industry over that time. I mean, millions of people are flying around every day. But the number of people who've made money carrying them around is very limited. And the capital has been lost in that business, the bankruptcies. It's been a terrible business. It's been a marvelous industry. So you do not want to necessarily equate the prospects of growth for an industry with the prospects for growth in your own net worth by participating in it.

Why didn't many early automobile or airline investments work out? There are a number of reasons, including the capital intensiveness of these businesses and fierce competition.

The auto industry needs to build expensive factories in order to grow, and airlines need to buy or lease planes in order to serve customers. Both industries have a history of unionized labor forces as well. These characteristics give each high fixed costs.

If demand goes down for any reason -- whether from an economic slowdown or a competitor stealing customers -- those costs remain, leaving airlines with half-full planes or auto companies running factories at less than full capacity. That's why so many airlines and car companies have gone bankrupt over the years.

The EV industry is similar

While electric vehicles are innovative and beneficial for society, some of these unfavorable business characteristics remain.

That's not to say you should avoid the sector entirely. But if you're invested in any of these companies, you need to genuinely believe that the company has an edge over competitors through technology, brand power, financial power, or management. That edge, or competitive moat, will be needed to navigate the ups and downs of this high fixed-cost industry and to protect your investment capital.

That's especially true since a number of electric vehicle makers are just now going public to battle with current leaders like Tesla (TSLA 2.36%) -- not to mention nearly every legacy automobile company now pivoting to EVs. Whether electric or gas-powered, the auto industry will likely remain intensely competitive for years.

If I had to bet which public EV company might have any sort of moat, it would be Tesla, thanks to its brand equity and leading battery technology, which it will update for investors on Sept. 22. That said, with its meteoric rise this year, I think Tesla's valuation has gotten ahead of itself.

If you believe you've genuinely found a competitively advantaged EV company at a reasonable price, then by all means invest. But if you do, heed Buffett's warning, and go into the investment with your eyes open.

As Buffett himself says: Investing is simple, but not easy.