What determines the direction of wind
Sunlight (heat), planetary rotation, and the shape of the land in passes over.

Prevailing wind is mostly caused by hadley cells, or the masses of air move due to the thermal difference between the pole and the equator as well as the surface of the earth and space. Thus it is the interaction of two different thermal convection cells. this moment twists into cells due the coriolis effect and the earths rotation.

Source

these cells can be somethat disrupted on the local level by things like mountains.