As automakers seek stakes in lithium miners to lock in supplies for electric-vehicle batteries, they’re following a path already forged by their shareholders.