Social Security collects money now and pays it out now to different people. It adds a system on top of that where some people receive more because they paid in more. But it does not invest money except for a modest amount in government securities. Even at its height, it was spending more than it was saving. Now it spends almost all of what it collects. During the last recession, it was spending more than it collected, spending down some of its savings.
The primary point of Social Security is not that it produces a better return. The primary point is that without Social Security, some people would not save for retirement at all. After all, they might die before getting a chance to retire.
In the beginning, most people did die before reaching an age where they could collect Social Security. As a result, the tax was quite low. There were many more workers paying tax than retirees collecting payouts. Over time, life expectancy increased. Modernly, most people live long enough to collect Social Security. The ratio of workers to retirees has been dropping.
Another justification for Social Security is that it insures against living a long time. On average, people live fifteen to twenty years after retirement. But some people die the first day and some people live another fifty years. If people save as if they were going to die on the first day but actually live another fifty years, they run out of money. If everyone saves as if they were going to live another fifty years but some die on the first day, they saved far more than they needed. Social Security is an insurance. It pools those risks such that it could save for the average and have enough to cover those people who live another fifty years.
Of course, Social Security is not currently saving enough to pay benefits with cost of living adjustments indefinitely. In about twenty years, its trust fund will be exhausted. Unless something is done prior to that, it will either have to find a new source of funding for about 25% of benefits or cut benefits by 25% (or some combination).
TL;DR: Social Security is mandatory insurance that pools risk and provides a modest benefit for all participants. Benefits over private savings: everyone has to pay; risk pooling.