Pressure gradients cause movement of air, i.e. wind. Wind blows from high pressure to low pressure. Wind can be looked at as a vector quantity. It has magnitude and direction.
What you saw was due to the fact that the direction of the wind at 2000 feet was different from the direction of the wind at 4000 feet. This is called wind shear (vertical wind shear in this case since we are concerned with the difference in the vertical direction.)
Wind shear can be caused my many different phenomenon, such as:
A frontal passage (sharp gradient in the temperatures of the air in the horizontal direction).
Temperature inversion (temperature usually decreases as you increase altitude, but in some case, over a layer of the atmosphere, it can increase)

Warm air has lower density (molecules have more energy and are bouncing around with greater intensity and speed) than cold air, a warm air pocket next to a cold air pocket causes a horizontal pressure gradient and wind to blow, if there's a pocket of hot air (due to a temperature inversion) above the cold air pocket, the reverse will begin to happen (over a layer, you will see that the red has move to the right and blue to the left) and you will see wind blowing in the opposite direction due to the new pressure gradient.
Thermal wind is a meteorological term (not referring to an actual wind), but a difference in the wind between two pressure levels; in essence, wind shear.