Electric vehicles and solar tend to get lumped together as partners in the climate-friendly push to phase out fossil fuels. Now they’re competing head-to-head for high-tech components that have been in short supply.