Pensions also invest in stocks, though the difference is that pensioners have no control at all. Of course, they also have guarantees of a certain level of income.
I think the main problem with the 401k is that not enough people actually contribute to one. Or they don’t put in enough.
But I very much doubt the average person who’d invested enough over several decades in a 401k feels like they got fleeced.