Taxes in retirement
You may be surprised that retirement isn't tax-free. When you set up your 401(k) or ordinary IRA you did so with pretax dollars. What this means is that your investment grew tax-deferred. When you access those funds you pay taxes at your ordinary tax rate. Unlike after-tax investments which are taxed at the often lower capital gains rate you'll pay taxes on these tax-deferred withdrawals as if you were still working.
Roth IRAs and Roth 401(k) accounts are not subject to income tax since these are funded with after-tax dollars.