When people think about charging electric cars, the first thought that comes to mind is: “So you are going to put charging stations at gas stations. There will be long lines of people waiting to charge their cars, since it takes much longer to charge an electric car than to fill a car with gas. It will never work.”

Capitalism will take care of building out the charging infrastructure. I guesstimate that it costs about $8 to fully charge my Tesla Model 3 at home (about 2.5 cents per mile) and $18 (6 cents per mile) at the Tesla Supercharger. My local utility charges 11 cents per kilowatt, and Tesla TSLA, +5.04% charges 24 cents. Thus, Tesla is making a 55% gross margin, or about $10, on every Model 3 customer who “fills up.” (Model X and Model S owners charge their cars for free.)

Of course, Tesla is charging 24 cents per kilowatt because it wants us to use its Superchargers only when we really need them — so that 55% gross margin is not sustainable and will decline. My prediction: At some point there will be a charging-station mini-bubble as companies raise capital and do a land grab. Grocery stores will use charging stations to attract customers. Charging stations will be in all parking lots, from restaurants to office buildings. Electric vehicle (EV) charging will be a gold rush, while gas stations will be just another relic of a bygone age, like phone booths and cassette tapes. Future EV batteries will have greater range, last longer, and charge faster.

The transition from internal combustion engine (ICE) cars to electric vehicles is a bit like the transition our ancestors went through when society switched from horses to gasoline-powered cars. At first, people wondered how they would “feed” those cars (grass was more plentiful than gasoline), whether they would have decent roads to actually drive anywhere, and whether cars would be crashing into pedestrians and each other. The shift from horses to cars required a completely new paradigm.

The domain of horses came with an ecosystem that was simply not applicable when we switched to cars. Even though both performed the same function — horses got people and goods from point A to point B — the automobile was fundamentally different, and so was its ecosystem.

I imagine the 110,000 U.S. gas stations that keep ICE cars humming along today will look like a rounding error next to the millions of electric “filling stations” that one day will be located in home garages and public parking lots.

Batteries lead the charge

The engine in an EV, though it will incrementally improve over time, is less important than the battery, which is the most expensive single part of the vehicle and a highly complex one, too. The battery in an EV needs to be treated tenderly to maintain its charge and longevity. Your iPhone, for example, is optimized for duration of a charge but not for battery longevity. First of all, Apple AAPL, +3.75% has an incentive to build planned obsolescence into its iPhone – it wants you to replace it every three years. Second, most iPhones don’t spend much time sitting outside in extremely hot or cold weather; they mostly remain in the comfort of your pocket, at a battery-friendly temperature. Not least, the cost of replacing a battery in your iPhone is less than $100, but replacing the battery in a Tesla costs $10,000.

Read: Relax, Tesla drivers — thieves don’t want your electric cars

Plus: Here’s how to capitalize on the electric car revolution — without buying Tesla’s stock

Tesla doesn’t own the battery-cell technology that goes into its batteries; that belongs to its partner, Japanese conglomerate Panasonic PCRFY, +0.46% 6752, +0.38% . Tesla designed the battery pack the enclosure that houses the battery cells) and the battery management system controller (computer) that routes and manages electricity flow and the microclimate of the battery cells.

The battery is a key technology for Tesla, but at the moment Panasonic is in control of a big part of it. Just as Apple chose to bring development of the CPU that powers its iPhone in-house, Tesla, which is vertically integrated, may eventually increase its control over its battery technology. The company’s purchase of Maxwell Technologies, which has a battery technology that may significantly lower the cost of cell manufacturing, is the first move toward independence from Panasonic.

On the one hand, this strategy has a great appeal because if Tesla is able to produce a better (more durable, lighter, longer-range, faster-charging) battery at a lower cost, it could become a source of a competitive advantage. Today Tesla doesn’t fully control its destiny when it comes to batteries, so if BMW BMW, -2.60% decides to use Panasonic’s cells, Panasonic will gladly supply it. BMW would still have to develop its own battery management controller, though.

On the other hand, this vertical-integration strategy could backfire. If EV batteries turn into a commodity and the aforementioned features become ubiquitous, then the lowest-cost manufacturer wins. Tesla would argue that vertical integration will ultimately result in lower costs. The company has built a giant battery factory in Nevada that it calls the Gigafactory. When it is fully operational, the Gigafactory will be able to manufacture twice the quantity of lithium-ion batteries produced globally today. Tesla owns the building, and Panasonic owns the cell manufacturing equipment.

Traditional ICE automakers that are tiptoeing into EVs have taken a more conservative strategy and are relying on suppliers (LG Chem 051910, +2.61% , Samsung SDI 006400, +0.48% , and others) to produce a complete battery for them.

One of the biggest differences between the Tesla battery and the batteries used in other companies’ EVs (like the BMW i3, Chevy Volt GM, -0.37% , and Jaguar i-PACE) is the metals they put in the cathode. Traditional car companies chose the NMC (nickel, manganese, cobalt) combination, while Tesla ended up making a less conservative choice of NCA (nickel, cobalt, aluminum). NCA offers long battery life, quick charging, and great performance. NMC, on the other hand, produces slightly less energy but is less volatile and withstands larger ranges and variations of temperature.

Tesla chose a more potent and more volatile cathode chemistry and elected to control its volatility by trying to manage the macroenvironment of the cells by a special design of the battery enclosure, in order to cool or warm the battery cells as needed. Each battery pack comes with an incredibly sophisticated battery management system that tracks the voltage and temperature of each cell and orchestrates which cells the Model 3 uses.

Lithium-ion batteries are a technology of the late 1980s. This was improved in the 1990s and the early part of this century at a somewhat slow pace (especially compared to semiconductors, which have followed Moore’s law, doubling in speed every 18 months). The rate of improvement has accelerated over the past decade (in large part thanks to Tesla), and the cost per kilowatt hour (kWh) declined to $127 in 2018 from $446 in 2013. The Tesla Model 3, for example, comes with a 75kWh battery, meaning the approximate cost of the battery has declined to $10,000 from $33,000.

From the perspective of how much it will likely evolve over the next decade or two, EV battery technology is still in its infancy. As we transition from ICE cars to EVs, the value of the prize will explode; tens if not hundreds of billions of dollars will be poured into improving the battery. Tesla, for example, has already gone through three reformulations of its battery. My $50,000 Tesla Model 3 has the latest version, which charges faster than the $90,000 Model X or the $80,000 Model S that Tesla sells today.

While in the short run battery technology is going to be an important differentiating factor, in the long run the EV battery will likely become a commodity and the differentiating factors will be in software and self-driving capability. An EV is a giant computer on wheels, and historically as computer hardware is commoditized, most of the remaining value is in the software.

Read more about how EVs will disrupt the auto industry, including whether Tesla and traditional automakers will survive in the long run, and who's right in the Tesla bull vs. bear debate.

Vitaliy Katsenelson is chief investment officer at Investment Management Associates in Denver, which has no positions in any of the companies mentioned. He is the author of “Active Value Investing” (Wiley) and “The Little Book of Sideways Markets” (Wiley).

How does one invest in this overvalued market? Our strategy is spelled out in this fairly lengthy article.

,

Read: 7 tips for buying your first electric vehicle

More: The best EVs and plug-in hybrids