It's caused by the uneven heating of the Earth's surface. Hot air travels up and cold air travels down. Hot air is present where the sun shines and cold air is present when there is no sunlight. The Earth rotates day and night. Imagine at one side of the Earth air travels up and the other side it travels down while the planet continues to spin. The waves form air currents and these are the winds we experience.