Auto companies are pouring billions of dollars into new facilities and supplier agreements as they strain to secure needed raw materials.