Alex Webb, Elisabeth Behrmann and Gerrit De Vynck

It’s the headquarters of Magna International Inc., the world’s biggest contract manufacturer of cars, which helps steer automakers through the laborious stages of design, engineering and assembly. For years, Magna has eased production bottlenecks for Volkswagen AG, Aston Martin Lagonda Ltd and BMW AG. The carmakers go to Magna when they need assistance manufacturing high-end vehicles. Its engineers do everything from working out the complex jigsaw puzzle of components sourced from a plethora of suppliers, to designing the automated factory that can build the car. Now, the $16 billion Canadian company is ready to build cars for Silicon Valley’s biggest companies—and become the Foxconn for a new generation of automakers.

“Becoming a carmaker is extremely difficult,” Magna’s Chief Executive Officer Don Walker said. “Most people end up coming to talk to us at some point.”

The rise of ride hailing, self-driving cars and electric vehicles has placed the automotive industry on the cusp of a dramatic change. Yet for all their expertise in software and consumer electronics, the tech behemoths don’t know how to piece together 30,000 components to make a car.

It’s an expensive process. A completely new vehicle can cost several billion dollars, so leaning on the expertise of an industry veteran is a way of minimizing those costs. Apple has been quick to understand that: about a dozen Magna engineers have been working with the iPhone-maker’s team in Sunnyvale to develop a vehicle, according to a person familiar with the arrangement.