Ad-hoc commands are used to do something quickly, and they are mostly for one-time use. Whereas Ansible Playbook is used to perform repeated actions. There are scenarios where we want to use ad-hoc commands to perform a non-repetitive activity.