A credit note (also credit memo or correction invoice) is an official document from the seller to the buyer. It shows that money was credited back to the buyer, fully or partly.
When do you need one?
When you refund an order (fully or partly).
When you cancel an order that was already invoiced.
In many countries a refund needs an official document by law.
Why does it matter?
It keeps your accounting correct.
It shows your customer the refund or cancellation was officially processed.
The credit note's Amount Due is 0, because it cancels or reduces the original invoice, which leaves a zero balance.