Today we have at least three "layers" of social security in most European countries: The first layer is that government makes sure everyone has employment and makes it difficult for employers to get rid of employees, even those ones that cost the company more than they're worth. For non-employed spouses, even divorced ex-spouses, it's the bread-winning ex-spouse that's on the hook for that layer of social security.
The second layer is mandatory social insurance.
The third layer is usually some kind of government handout that kicks in for people who, for some reason, fall through both the first AND the second layer of social security. (e.g. [1] in Austria)
My guess would be that each layer was brought in at a time when the layers below were not yet in place, though, maybe, someone can provide the necessary facts to the contrary here.
I just wish they'd do away with all that crap, and instead just implement universal basic income, paid for by the tax payer.
[1] https://de.wikipedia.org/wiki/Bedarfsorientierte_Mindestsich...
Regulations are written in blood. They are always Chesterton's fence. That doesn't mean it's still a good idea, or even that it ever was. But there's a reason it was put there, and it's wise to at least know why before removing it.