Investing in such accounts can earn interest or dividends that are taxed as they are earned or capital gains that are taxed as they are realized, even though contributions to such accounts are not tax deductible. Investing income is taxed when earned or realized, but withdrawals are not.