It is used for automation of configuration processes. You inform Ansible what is the DESIRED state and Ansible will try to achieve it, no matter what the CURRENT state is. Example: you want to have a file in a spcified location with a specified content. There ar ea few possible starting points:
- the file does not exist - Ansible will create it
- the file exist, but has a different content - Ansible will update the file
- the file exists and has the right contnet - Ansible will do nothing