Liquidating trust and taxable event
A trust is considered by tax law to be a modified conduit, because usually only some of the income and deductions pass through to the beneficiaries.
The trust itself often retains some income, especially capital gains, which is usually allocated to the trust corpus.
Likewise, any taxable distribution to beneficiaries is deductible by the trust.
Gift taxes may also apply to either property transfers to a trust or distributions to beneficiaries.
Tax-exempt interest is added because it is not includible in taxable income, but it is available for distribution to the beneficiaries.
Since the tax-exempt interest is distributed, the expenses allocable to the interest are also subtracted.
However, if the income is distributed, then the beneficiaries pay taxes on it and the trust is permitted to deduct it.
Capital gains that are allocated to trust principal are subtracted from taxable income because the gains are not distributed to the beneficiaries.
For the same reason, capital losses that are allocated to trust principal are added back, because the losses decrease taxable income, but do not decrease the income that is available for distribution to the beneficiaries.
Trust property consists of principal (aka corpus), which is the property transferred to the trust by the grantor, and income earned by the trust, usually from investments.
If the trust retains income beyond the end of the calendar year, then it must pay taxes on it.