When the wind is not flowing strongly, the flow lines in the air are relatively staright. This is called laminar flow. As the wind speed increases it reaches a threshold beyond which laminar flow becomes turbulent. Vortices (like a stirred fluid like whirlpools and smoke rings) in the turbulent flow of air makes the flag to flap.