Wind vanes are designed to rotate freely on the vertical axis so they can respond to small changes in wind direction (shown by blue arrow). The weight on either side of the vertical axis is equal, but the surface area is much larger on one side. That side will catch the wind if the pointer is not pointing directly in line with the wind. The vane tends to get stable equilibrium so the pointer always points the direction from which the wind blows.
The letters indicate the points of the compass.In modern designs wind vanes can send the wind direction to a data logger using a potentiometer; as the vane rotates, the resistance of a potentiometer changes.