All transactions are voluntary but they are also verified by 3rd parties to prevent tax avoidance and other shenanigans.
For example if I want to leave a property to some one if I gift it to them they (or I) will have to pay tax on it just like on any other transaction the value of the property would be assessed and it will be taxed.
This happens regardless of the sum of the transaction so I can't just sell it to them for 1$ so effectively no tax would be paid, in these kinds of transactions they usually tax the value of the transaction unless it was substantially lower than the estimate (most government estimates are some what low balled).
If I report a transaction for a value considerably lower than the estimate they'll investigate it which usually would result in a new estimation and if that one is as well differs considerably than the transaction amount there would be an investigation regarding possible tax evasion.
Corporations aren't different when they exchange assets the valuation figures are reported to the authorities if the regulatory body thinks the estimates were set higher or lower than their actual value they can choose to open an investigation and if need be fine or prosecute the offending parties.