When you build public facing APIs, there are operations that could not fit enough into request-response cycle. Especially, when it involves user interaction.
Take an example of sending email. You can expose an API endpoint for clients to send email. But whenever the email is opened, the client want to do some action. They can keep polling you and get the status of the email of course. But, that’s suboptimal on both sides. So you want to tell the client when the email is opened. Now, that’s when you do webhooks (ref).
Webhooks are easier to build. After all, it’s just one http call you will have to make.
But, testing it is not so.