To tilt at windmills is to confront and engage in conflict with an imagined opponent or threat. The idiom alludes to Miguel de Cervantes's Don Quixote, a popular Spanish novel written in the seventeenth century. The title character, Don Quixote, attacks a group of windmills with his lance at full tilt (poised to strike) when he mistakes them for a group of ferocious giants.

 

So saying, he gave the spur to his steed Rocinante, heedless of the cries his squire Sancho sent after him, warning him that most certainly they were windmills and not giants he was going to attack. He, however, was so positive they were giants that he neither heard the cries of Sancho, nor perceived, near as he was, what they were, but made at them shouting, "Fly not, cowards and vile beings, for a single knight attacks you."

--Miguel de Cervantes, Don Quixote, chapter VIII.