What is the main purpose of creating a windmill?

It is a mill. The wind is a power source