A windmill is a structure used to harness the power of the wind for purposes like grinding grain, pumping water, and generating electricity. Wind causes the blades of a windmill to spin, these blades are connected to the shaft of a generator and the generator generates electricity.This electricity is used for pumping water or grinding grain.