Wind is caused by energy from the sun and the rotation of the earth. There are many other influences on wind that help to mould its speed and direction but it is these two forces that are responsible for the flows. Wind is the flow of air from areas of high pressure to areas of low pressure; to understand it we need to understand how these pressure differences are created.
The distribution of the sun’s rays across the Earth is not uniform. Firstly, they are more concentrated at the equator. This is down to the angle of incidence at which the sun strikes the surface. If the sun is coming from a high angle, such as at meridian when it is directly overhead, the energy it delivers to the surface is spread over a much smaller surface area than if it has a low angle of incidence, such as close to sunrise or sunset. On top of this, it also has less atmosphere to travel through, and as such less of it is absorbed or reflected back into space.
Relatively little of this energy is absorbed by the atmosphere on the way in. Much of the energy is high frequency radiation which is not easily absorbed by oxygen and nitrogen, the two main components of the atmosphere. When it strikes the earth, however, it is absorbed and can then be re-radiated at frequencies much more easily taken in by the air.
The quantity of energy absorbed and reradiated depends on the albedo and absorptive properties of the land. Clouds and ice have high albedos and reflect a large amount of radiation back into the atmosphere at high frequency. Grassland and water have lower albedos and absorb much of the incoming radiation. Air close to land is directly heated by it but because of variations in latitude, albedo and absorption/radiation of different areas different bodies of air are heated at different rates. Hot air is less dense than cold air and so the differences in heating create pressure differences.
Another cause of pressure difference is the rotation of the earth. Because the earth rotates air at different altitudes moves at different speeds. This causes the air to mix which results in turbulence. Particularly where there are obstacles such as mountains, this turbulence can cause pressure differences, also resulting in wind on the Earth’s surface.
Once there is a difference in pressure, wind will flow from an area of high pressure to area of low pressure until the pressure difference is resolved.