Here's another way to look at it:
The government is always going to want to tax your money. Think about it in terms of whether they have already taxed what you've invested or not.
With an IRA or 401k or most other "tax-advantaged" accounts, you are depositing money (usually through a paycheck deduction) that has NOT been taxed yet. And it can grow (increase in value over the years, + earn and reinvest dividends) without paying taxes on the growth & earnings. So the value of compounding is that much bigger. But when you withdraw that money when you're older, the IRS wants its money. and NONE of that money has ever been taxed as income, so you pay tax on ALL of it, just as if it were income.
With a regular brokerage account (your TD Ameritrade), the money you've invested has already been taxed. You used money that you've been paid after taxes. So the IRS doesn't need to double-tax that money. However, the earnings and growth have never been taxed. So they want a piece of that. Someone somewhere decided that this isn't regular income, so they tax those earnings/growth/gains at a different rate. That's the capital gains tax.
Looking at this way, helped me remember what was what.