How is \Magento\Sales\Model\Order\Payment\Operations\CaptureOperation::capture() implemented and used?

A post was split to a new topic: How to set the amount to trigger error ‘payment declined’?