Retirement tax questions

My issue is with how the trust is funded.  I don't understand how, if the trust is funded by someone else (relative, lawsuit settlement, etc.) and the beneficiary never paid tax on it, how does the beneficiary have a basis to deduct the expense?  If I have tax-free money in an HSA or FSA (I never paid tax on it because it was deducted pre-tax), I can't deduct expenses paid with FSA or HSA reimbursements.  If I have insurance paid with pre-tax premiums, I can't deduct expenses paid for by insurance.

 

So going back to @NCperson 's two examples.  In example #1, the trust distributes $10,000 of earnings.  That's taxable to the beneficiary, and the beneficiary can include the expenses as schedule A deductions.  That's exactly what I would expect.  But what about example #2, where the trust distributes principle.  No income, no tax for the beneficiary.  Can the beneficiary take schedule A, and if so, why?  

Or example #3, the trust distributes $5000 of principle and $5000 of earnings, the beneficiary reports $5000 of taxable income.  How much can the beneficiary deduct?

 

 

Separately, if I was wrong on the tax being owed on the earnings every year, and only owed when the earnings are paid to the beneficiary, then I learned something today.