The main cause of the rise of labor unions was the rapid industrialization of the US economy.
During the post-Civil War period, the US economy became very industrialized. This meant that more and more people were working in factories owned by large companies rather than working in small workshops for themselves or for a small business-owner. In addition, huge numbers of immigrants were coming over to the US. They (along with people moving to cities from the rural areas) created a huge pool of labor that drove down labor prices and the quality of working conditions.
During this time, then, pay was low and working conditions were bad. People were working in factories for large companies. These factors combined to make many workers unhappy with their station in life. They wanted to get a better deal for themselves and they thought that unions were a good way to achieve that. In this way, industrialization led to the rise of labor unions.
While the history of organized labor and labor unions in the United States is as old as the nation itself, the dramatic increase in the power of unions did follow the massive scale of industrialization and concomitant expansion of the means of transportation that occurred in the years following the Civil War. Industrialization, in contrast to the slave-intensive and geographically dispersed agricultural sector that dominated the economy of the southern states, forced the concentration of workers into more confined spaces characterized by more dangerous work conditions and much longer hours. Managerial excesses -- in effect, inhumane work conditions prevalent in most factories -- spurred the proliferation of labor unions with their demands for improved conditions, including higher wages, fewer work hours, medical assistance for those injured on-the-job, and paid vacation days. The creation of the American Federation of Labor at the end of 1886 represented one of the nation's most significant developments with respect to the legitimacy of organized labor as a fundamental component of society.
An added dimension that warrants discussion was the emergence of political theories that proved influential among some in the American, and European, labor movement. The advent of socialist policies and the influence of Karl Marx, Frederick Engels and others provided a compelling philosophical underpinning to the efforts on the part of some labor organizers to advance the cause of workers relative to the interests of business owners. The main American labor reformer of this period, Samuel Gompers, was not as ideologically-driven as the socialist movement's core adherents. Gompers took a more pragmatic approach to organized labor, but the obstinacy of most factory owner was such that even he appreciated the more militant passions that motivated Marx's followers.
Irrespective of the philosophical discussions that raged during the post-Civil War era, its was the fact of unfair and unsafe working conditions to which hundreds of thousands of American laborers were routinely subjected that led to the expansion of organized labor and the growth of the power of unions.