Allocate a margin amount to shipments

Hi, colleagues!
Who can explain me the appointment functionality “Allocate a margin amount to shipments”?!
I don’t understand why margin amount reversal after posting General journal with Transaction type field = Settlement on the Payment tab.