We normally assume that capital gains tax rates are always lower than regular income tax rates (or at least equal). The portion of long-term capital gains that is in the old 10/15% tax bracket is taxed at zero. The portion greater than that but less than the old 39.6% tax rate is taxed at 15% and then any portion above that amount is taxed at 20%.
However, not all capital gains are treated the same. The capital gain on selling a machine shed is considered to be Section 1250 gain. It is still a capital gain, however, in this case, the maximum tax rate is 25% but there is no reduction in the rate if you are in a lower tax bracket.
For example, assume that a married couple sold a machine shed for a $100,000 Section 1250 gain and that was their only source of income. If this was a regular long-term capital gain, the federal tax would be zero (all of the gain is in the 10% and 15% tax bracket). However, since this is all Section 1250 gain, the actual tax owed is $8,742 (2018 tax rates).
Now if a farmer sells a machine shed, there is usually part of this gain that is ordinary and part that qualifies as Section 1250 gain. With the new Section 199A deduction we will now have situations where the ordinary income will be taxed at a lower rate than the "special" Section 1250 rate.
For example, let's assume that $50,000 of our $100,000 gain is ordinary and $50,000 is Section 1250 gains. The ordinary gain will qualify for the new 20% deduction. The new calculated tax ends up being $8,118 or a $624 tax savings.
The tax savings can get even more dramatic as your income increases. If the taxpayer is in the 24% tax bracket and has $100,000 of Section 1250 gains, the tax would be $24,000. If the gain was ordinary income and the full Section 199A deduction was allowed, the tax would drop to $19,200 or a savings of $4,800.
As you can see, not all capital gains are treated equally, but under the new 199A rules none of them qualify for the deduction, whereas the ordinary gain may qualify.