Earlier quoted context omitted.
Makes a huge difference when considering the tax implications.
Many retirement funds are in a tax shelter either way, though.
Also I keep money in index funds even if I don't plan on using that money for retirement. (e.g. downpayment on a house, saving for another large purchase, financial buffer, etc.) I also keep money in index funds that are in regular brokerage accounts because 401k + backdoor roth ira isn't sufficient for retirement if you make $200k+/yr. (True for even lower amounts too but whatever)