How is \Magento\Sales\Model\Order::cancel() implemented and used?

Context: How to cancel an order programmatically?

Implementation

Details:

Usages

1. \Magento\Authorizenet\Controller\Adminhtml\Authorizenet\Directpost\Payment\Redirect::execute()

2. \Magento\Paypal\Controller\Express\AbstractExpress\Cancel::execute()

3. \Magento\Sales\Controller\Adminhtml\Order\Cancel::execute()

4. \Magento\Sales\Controller\Adminhtml\Order\MassCancel::massAction()

5. \Magento\Sales\Model\AdminOrder\Create::createOrder()

6. \Magento\Sales\Model\Service\OrderService::cancel()

Details: How to cancel an order by the /V1/orders/:id/cancel Web API?