How is the «Refunded» column implemented for the backend's credit memo grids?

There are 2 credit memo grids in the backend:

In the «Sales» → «Credit Memos» section:

On the «Credit Memos» tab of an order screen:

Magento\Sales\Ui\Component\Listing\Column\Price::prepareDataSource():

Data source: sales_order_creditmemo_grid_data_source

It is implemented by the Magento\Sales\Model\ResourceModel\Order\Creditmemo\Grid\Collection class:

See also: