How Ansible verifies installations

Hello,
I am new here and I would like to deploy open source configuration management software in my company and I need information on verification of installations.
How Ansible manages to verify an installation of package or other software?
Is there possiblity to verify already installated packages or other software on a remote machine with Ansible?

Regards,

the same way you install a package verifies if it is already
installed, for example:

yum: name=vim state=present

will install the package if not present or return changed=false if it
is already installed.