An iPhone assembler, e-commerce emporium and real-estate developer typically don’t compete in the same business – except when it comes to electric vehicles in China. EVs has spurred billions of dollars in investments by traditional carmakers, startups and titans of the internet, electronics and real-estate industries.