A handler is like a regular task in a playbook in Ansible. But it runs only if a task alerts the handler. Handlers are loaded automatically by roles/<role_name>/handlers/main.yaml.
These are run just once, after the completion of all the tasks in a particular play.