Surface wind is formed as a result of three factors: pressure gradient force, Coriolis force and friction. Pressure gradient force, or PGF, occurs when two nearby regions have differences in atmospheric pressure. Coriolis force is caused by the Earth's rotation. Friction causes air to spiral up and down but only affects air after it is in motion.
PGF comes into play because wind is essentially moving air. As air moves from a region of high pressure to a region of lower pressure, wind is formed. Any change in pressure causes wind, and greater differences in pressure cause stronger wind. A small example of PGF can be found in mountainous regions. During the day, winds blow uphill because the mountainside is hotter than the area below. Conversely, winds blow downhill at night when the mountainside cools.
Coriolis force comes about from the Earth's rotation and causes moving objects to shift to the right if they are in the Northern hemisphere or to the left if they are in the Southern hemisphere. This force is strongest near the poles and nonexistent at the equator. When winds form close to the surface, friction causes them to slow down. This also decreases the effect of the Coriolis force.