Automakers increasingly see software as a way to distinguish their vehicles and add services after purchase. But attempts to develop complex systems in-house have often proved expensive and slow: Volkswagen’s Cariad accumulated more than $7.5 billion in operating losses over three years, and the group has turned to partnerships with Rivian and China’s XPeng to help develop software.