The first job is a ceiling on the entity's deduction. Section 661(a) allows an estate or complex trust a deduction for income required to be distributed currently plus any other amounts properly paid, credited or required to be distributed, "but such deduction shall not exceed the distributable net income of the estate or trust." Section 651(b) does the same for a simple trust. Without that limit an entity could deduct a large distribution of principal against a small amount of income and generate a loss out of nothing.
The second job is a ceiling and a description for the beneficiary. Section 662(a) includes in the beneficiary's gross income what was distributed, subject to the same DNI limit, and where distributions to all beneficiaries exceed DNI it prorates the includible amount among them. Section 661(b) then supplies the character: the deductible amount is treated as consisting of the same proportion of each class of income entering DNI as that class bears to total DNI. So a trust holding both corporate bonds and municipal bonds passes through a proportionate slice of each, and the municipal interest arrives at the beneficiary still tax-exempt. Section 661(c) closes the matching loop by denying the entity a deduction for the part of the distribution made up of items that were never in its gross income.
Simple and complex are not descriptions of a trust's paperwork. Section 651 applies to a trust whose terms require all income to be distributed currently and which makes no charitable set-aside; section 661 applies to everything else, including any year in which such a trust distributes principal. The Instructions for Form 1041 add a point that surprises people: the classification can attach to a portion rather than to the whole, so a trust may be "part grantor trust and part 'other' type of trust, for example, simple or complex."
Capital gains usually stay behind, and that is the practical heart of it. Section 643(a)(3) excludes gains from the sale of capital assets from DNI to the extent they are allocated to corpus and are not paid, credited or required to be distributed to a beneficiary during the year, or set aside for charity. Trust instruments and state principal-and-income rules ordinarily send gains to corpus, so the default outcome is that a realized gain is taxed inside the trust at the compressed estate-and-trust rates rather than at the beneficiary's own rate. Those rates reach their top at a very low level of income, which is the reason the allocation of gains is drafted rather than left to chance, and it is the same compression that makes the 3.8% net investment income tax bite at a far lower income for a trust than for an individual.
Two elections and one rule move the boundary. Section 663(b) lets the fiduciary of a complex trust, or the executor of an estate, treat any amount paid or credited within the first 65 days of a year as paid on the last day of the preceding year. The Instructions for Form 1041 add the conditions: the return must be filed by its due date including extensions, and the election once made is irrevocable. It is a genuine planning lever, because it lets a fiduciary see the year's actual income before deciding how much to push out. Section 663(c) treats substantially separate and independent shares of different beneficiaries as separate trusts or estates for the sole purpose of computing the DNI allocable to each, so one beneficiary's distribution does not drag another's income onto their return. And section 663(a)(1) takes a specific bequest of a sum of money or of specific property out of the system entirely, provided it is paid in not more than three installments.