The formation of tornadoes is complicated.
First, a condition called wind shear, in which the speed and/or direction of the wind changes with altitude. If the shear is strong enough it can essentially tilt a thunderstorm, this separates the updraft and downdraft of the thunderstorm, preventing them from interfering with one another. This allows the storm to become stronger and last longer.
Additionally, if the wind shear is strong enough it can start the air rolling in what is called horizontal vorticity. This horizontal vorticity can then be turned vertical by a thunderstorm's updraft. When this happens, the thunderstorm may start rotating. The rotation is especially strong in an updraft called a mesocyclone. If the storm intensifies rapidly enough, a relatively warm downdraft called a rear-flank downdraft or RFD can wrap around the bottom part of the mesocyclone. This can then tighten and intensify its rotation and bring it down to the ground to produce a tornado. In addition to tornadoes, very heavy rain, frequent lightning, strong wind gusts, and hail are common in such storms.