A jet stream forms high in the upper troposphere between two air masses of very different temperature. The greater the temperature difference between the air masses, the faster the wind blows in the jet stream. read more
And since the jet stream is a thermally driven phenomenon, the more complicated the three-dimensional temperature structure of the earth's atmosphere, the more 'wandering' will take place in the course of the jet stream. read more