In general, socialism came as a reaction to the Industrial Revolution. It sprang up as workers reacted to the new conditions in which they had to work.
As the Industrial Revolution began, workers started having to work in different conditions. They had to work for someone else instead of for themselves. They had to come to work when they were told and leave when they were told. They stopped having any kind of control over their working lives.
Socialism sprang up as a reaction to this. It said that workers ought to be their own bosses. It said that they should not have to work for others and make others rich instead of working for themselves.
So socialism started as a backlash against the changes in workers' lives. It wanted to give them back the control over their work that they used to enjoy.
Marx is one of the first thinkers on the scene to link the profiteering off of human labor as creating the conditions for a post- capitalist world. The idea he put forth was that the industrial revolution was capitalism gone unchecked. Essentially, few were becoming extremely wealthy at the cost of the many. The industrialist would own a factory and employ workers at low wages, resulting in large sums of money for himself. As capitalism increased, the exploitation of workers increased. At some point, the belief is that these workers would call for change. The change would involve a transformation from a private ownership of wealth and means of production to a public, or social, one. It is from this idea that socialism emerges, an economic system where there is a public ownership of wealth and that the workers, or those who were previously oppressed, are now able to be in a position of economic autonomy and freedom.