Why is the Social Security tax split midway between employer and employee? On page 99 of Hidden Order, David Friedman writes:

Social Security taxes are paid half by the employer and half by the worker. How would the effect of the tax change if it
were collected entirely from the worker or entirely from the
employer? Why do you think Social Security is set up this
way?

Earlier in the book, Friedman proved that who actually pays a tax - that is, whether the money comes out of the profits of the producers or is paid by the consumers in the form of higher prices - is not determined by who hands over the money to the government, but whose supply/demand curve is more elastic. That is to say, asking the producer to pay some tax per widget sold is equivalent to asking a consumer to pay the same tax per widget bought. If the demand for the widget is inelastic, much of the tax burden would fall on the consumer and not if the widget has a fairly elastic demand curve.
In light of this fact, it shouldn't matter which way the tax burden of Social Security is split. If the employer had to pay the entirety of the tax, she would pay a proportionately lower salary to the employee; if the tax burden fell solely on the employee, his salary would be higher.
One possible explanation of the present setup of Social Security is that voters don't understand economics. Although this answer works remarkably well as a justification for other inefficient government practices like trade barriers and rent controls, it flies in the face of the &quot;don't attribute to incompetence what can be explained by rationality&quot; principle that Friedman has adhered to throughout the book.
I am not from the US so I could be missing something obvious here, but given what I know I can come up with no better explanation. Any help would be appreciated.
It is actually a little bit more complex because there are special cases where there might be no tax burden shifting (see discussion in Mankiw Principles of Economics ch 12) although, generally speaking the statement of D. Friedman would be correct.
As to why government does that, besides incompetence that should not be too casually dismissed, there might be completely rational reasons.
If people do not understand economics, and if people do not understand that they are still being taxed, they might be more likely to vote to candidates that they believe are not taxing them (regardless of whether they are actually being taxed or not). This is fully consistent with those voters being rational mind you since rationality only requires people to act consistently with their beliefs and  makes no assumptions on what peoples beliefs are (see more discussion of rationality in Tadelis Game Theory: An Introduction). Consequently it might be rational for politicians to do this to maximize their votes.
For example, consider analogy with food producers. Some food producers put on their food labels reading &quot;no chemicals&quot;. This is prima facie absurd statement as anything made from ordinary matter even plain water is by definition made from chemicals. To have food without any chemicals the food would have to be made out of plasma  or dark matter. Even interpreted generously as meaning there are no synthetic chemicals, there is no real difference between synthetically made atoms and molecules and the same atoms and molecules being produced by nature.
Yet customers who are illiterate when it comes to physics and chemistry might still prefer such products 'without added chemicals' making it rational for profit seeking companies to produce such products.