Like Puppet or Salt, Ansible is a configuration management system. Ansible does not have a custom agent. It usually works with SSH, though it also supports other modes, like Docker or local-based actions.
When using SSH, Ansible calculates the commands locally. It then sends simple commands and files through the SSH connection.
By default, Ansible tries to use the local SSH command as the control machine. If the local command is unsuitable, Ansible falls back to using the Paramiko library.