A passing star may have kicked the solar system’s weirdest moons into place