discount_tax_compensation_amount is calculated in 4 places.
- If catalog prices entered from Magento Admin do not include tax, then
discount_tax_compensation_amountis always 0: - If catalog prices entered from Magento Admin include tax, then
discount_tax_compensation_amountcan have a non-zero value:
-Magento\Tax\Model\Calculation\AbstractAggregateCalculator::calculateWithTaxInPrice()
See also: