From my (admittedly very limited) understanding, Ansible is more "automation software" in that it has a controller which is responsible for issuing commands to clients.
So you run Ansible on your computer, it will communicate with your server over the internet and give it a list of instructions on how to install Lemmy.
Ansible works over SSH. You install Ansible on your local machine and it connects over SSH to run the playback.
To your VPS it looks like a user has logged in and is running commands. It's very useful for remote management of thousands of servers because you don't need to install anything, they just need to have SSH enabled.