Tilting at windmills is an English idiom which means attacking imaginary enemies. The word "tilt", in this context, comes from jousting.
The phrase is sometimes used to describe confrontations where adversaries are incorrectly perceived, or courses of action that are based on misinterpreted or misapplied heroic, romantic, or idealistic justifications. It may also connote an importune, unfounded, and vain effort against adversaries real or imagined for a vain goal.
The phrase derives from an episode in the novel Don Quixote by Miguel de Cervantes, wherein protagonist Don Quixote fights windmills that he imagines are giants. A relevant portion of the novel states:
Just then they came in sight of thirty or forty windmills that rise from that plain. And no sooner did Don Quixote see them that he said to his squire, "Fortune is guiding our affairs better than we ourselves could have wished. Do you see over yonder, friend Sancho, thirty or forty hulking giants? I intend to do battle with them and slay them. With their spoils we shall begin to be rich for this is a righteous war and the removal of so foul a brood from off the face of the earth is a service God will bless."
"What giants?" asked Sancho Panza.
"Those you see over there," replied his master, "with their long arms. Some of them have arms well nigh two leagues in length."
Cervantes wrote Don Quixote in two parts, published respectively in 1605 and 1615, during the latter part of a historical period known as the Spanish Golden Age. During this age, Spain pursued military conquests in parts of Europe and conquered large parts of the Americas, which brought great riches to the country and inspired a flowering of the arts. In La Mancha, Castilla, there are still some of the old windmills that Don Quixote found in his adventures.
Cervantes wrote and published Don Quixote during the Eighty Years' War, or Dutch War of Independence (1568–1648), a revolt by the Habsburg Netherlands to end Spanish rule. In Don Quixote, the eponymous protagonist consistently misinterprets his own, his adversaries', and his allies' actions and motives — regularly resulting in apparently unjustified violent actions and consequences. One way of interpreting Don Quixote's tilting at windmills could be as an allegory to promote critical, skeptical, or satirical evaluation of either a hero's motives, rationales and actions, or a nation's foreign policies.