A handler is an ordinary task that sits idle until a task notifies it, and only a changed result does the notifying — which is how a service is restarted exactly when its configuration changed. Running first is pre_tasks, retrying is until with retries, and tag selection is unrelated to notification.
Official docs