Capitalism is a concept, a tool to organize production in a society. It doesn't do anything by itself.
And the capitalist didn't do any of those things.
It was the social democracy that demanded and made capitalists around the world to share the benefits of the system to the rest of the society.
For example in the Victorian era Britain the working class people were dirt poor working 16h a way 7 days a week. The capitalists didn't give anything willingly the working people had to demand these things via unions, labor movements and social democracy.