Every cash on delivery payout to a client is a bank transfer, and the bank charges a commission on it. Without a way to pass that commission on, the courier pays it, payout after payout.
The transfer fee is a setting on each client. It is zero until you set it, so you choose which clients pay it and how much. Once it is set, the fee is added to each client settlement for that client.
The fees are not invoiced one by one. They are collected and billed once, on the client’s next invoice. If that invoice is canceled, the fees it carried are released and go on the next invoice instead.
For a courier paying out cash on delivery to many clients, this turns a steady small loss into a line on the invoice.