How are the interceptors generated on «setup:di:compile» in Magento 2.2?

The interceptors are generated on the stages 4 and 5 of setup:di:compile:

Interceptors generation… 4/7
Interceptors generation… 5/7

1. Magento\Setup\Module\Di\App\Task\Operation\Interception::getName()

2. Magento\Setup\Console\Command\DiCompileCommand::getOperationsConfiguration()

3. Magento\Setup\Module\Di\App\Task\Operation\Interception::doOperation()

Details: How does Magento\Setup\Module\Di\App\Task\Operation\Interception::doOperation() work?

See also: