Automakers racing to develop battery-powered, software-driven vehicles to compete with Tesla Inc. are confronting a new challenge: what technology to build themselves, and what to keep buying from suppliers.

Becoming more vertically integrated by doing more manufacturing in-house represents a major shift for most global automakers, who have relied for decades on suppliers to produce critical parts and software, and manage sprawling manufacturing networks in low-wage countries.

But some established automakers are embracing drastic changes to their longstanding build-or-buy calculations. One factor is the success of Tesla's electric vehicles, which rely on proprietary technology the company develops and manufactures itself. Another is the financial damage done by supply-chain breakdowns during the pandemic.