Auto makers have hefty electric vehicle goals, but the roadblock to all those grand plans might just turn out to be batteries. So they’re scrambling to control their own destinies by coming together with battery companies. Ford Motor (ticker: F) is the latest to surprise investors and analysts with an announcement.

Ford and SK Innovation (096770. Korea) are forming a partnership to make batteries that can produce enough cells annually to make hundreds of thousands of EVs a year by mid-decade. And the number of batteries can be quadrupled by 2030. With the higher capacity, EVs would likely be more than 50% of Ford’s total sales—an aggressive goal but not unusual in the auto industry.

General Motors (GM) has laid out plans to launch 30 new all-electric models by 2025 and wants to be an all-electric car company by 2035. Volkswagen (VOW3. Germany), the world’s largest auto maker by unit volume, wants to all-electric vehicles make up 50% of sales by 2030. The numbers from Ford, GM and Volkswagen show that EV production is set to grow rapidly. And they don’t factor in what Tesla (TSLA) is churning out or EV startups such as NIO (NIO), Lordstown Motors (RIDE) and Fisker (FSR). But more EVs take more batteries—and that is the challenge for the auto makers, RBC analyst Joseph Spak pointed out in a Sunday research report. “Remember, autos is not only competing against itself, but also commercial vehicles, energy storage, etc.,” he wrote.

Utilities, for example, will want lithium-ion batteries, too, as intermittent renewable power generation takes a larger share of the electricity pie. Batteries, essentially, store the wind or sun, enabling renewable generation to become part of the baseload generating capacity. Competition from another industry isn’t something the auto makers have faced before. “At this point, battery capacity is likely to be the [number one] inhibitor to the pace of electrification penetration,” Spak wrote. 

That’s why the auto makers are forming joint ventures, or JVs. “We continue to see JVs and partnerships between auto makers and battery companies,” Spak. The output from a JV battery plant is dedicated for one auto maker—and the capital required to build the plant is shared, lowering the car company’s cost burden for the car company and leveraging the battery maker’s technological expertise.

Spak sees car companies getting deeper into batteries down the road. “At a high level, the battery pack can be viewed as the key component; certainly it is the highest value component,” he wrote. “Why wouldn’t an OEM [original equipment manufacturer] want as much control over that as possible?”

As auto makers invest in battery capacity, Spak believes battery companies will invest in lithium mining. The car companies could even end up owning lithium mines. Tesla set the example. The EV pioneer has a JV with Panasonic (6752. Japan)—and an offtake agreement with Piedmont Lithium (PLL). An offtake agreement helps new miners finance projects; Piedmont is building a mine in North Carolina.

Read more: Batteries Are What Will Spark Electrical Vehicle Sales. And Auto Makers Are Buying In.