First, it is important to understand what socialism is. Socialism states that everyone shares everything, this includes land, money, and work. Now, in the 19th century, industrialization made the rich richer and the poor poorer. The quality of jobs decreased and people fought to increase wages and benefits. As you can imagine, people were angry at the government and rich business owners.
Imagine being in their footsteps. All of a sudden, you hear that everyone can share everything if the country and people are socialists. This resulted in a few countries changing their way of thinking and revolting against their governments. Soon, a few countries started making changes.
Hope this Helps! :)