Cold air originates from the two poles, and warm air originates from the equator. Wind systems rotate in a circle because the earth is rotating on its axis. A lot of the warm air masses come from over the water, because water holds heat better than land, so the wind systems are like a energy distribution system because they balance out the atmosphere by redistributing heat from the equator and cold from the poles.
When cold air meets warm air, the warm air is forced up because cold air is more dense, when the warm air gets high enough it will cool, condense, and precipitate (rain).