Ansible playbook is a structured unit of scripts that describes work for server configuration. It is used for repeated actions.
An ad-hoc command is used to do something quicker, mostly one-time use.