Bibhrajit Halder left the Midwest and a job developing autonomous trucks for Caterpillar Inc. about a year and a half ago to join Ford Motor Co. in the San Francisco Bay Area, where the auto maker is working on self-driving vehicles.

The Dearborn, Mich., auto maker, however, soon lost the software engineer to Faraday Future Inc., an electric-car startup luring auto industry veterans with Silicon Valley-like perks including stock options, free health care, catered lunches and foosball tables.

...