At the beginning of the Civil War, both sides believed that they could win the war and, more important, that the war would last only for several months. As the war dragged on, it became clear that the side with the greatest number of people and manufacturing capability had a significant edge--in this case, that was the North.
When war broke out, the South had two or three advantages over the North. For example, many of the wealthiest people in the South saw the war as a way to defeat an existential threat against their way of life, and they wanted to defend their way of life with all their power. The existential threat, of course, was the desire by the North to limit slavery and then to abolish it, which would have fundamentally altered a major part of the South's economy. So, many people in the South were literally fighting for a way of life. Others were fighting in the belief that a central government should not interfere in the government of a state.
In addition to a passionate defence of a way of life and state's rights, the South had a long tradition of military service. Many of the leading citizens in the South were either former US officers or serving officers, and most had gained their military experience in the Mexican-American War, including the man who became the war's most well-known general, Robert E. Lee. And although the North had its fair share of experienced officers, most historians would argue that the South had a meaningful edge in experienced officers when the war started. With very few exceptions, currently serving US officers who came from southern states resigned from US service to fight for their states.
The North had two great advantages that, the longer the war lasted, became insurmountable advantages. The first was a much larger pool of available soldiers than the South had. Unlike the South, which was still largely agricultural in 1861, the North had many large cities and was heavily urbanized compared to the South, and, most important, was much more industrialized than the South, with the consequent ability to manufacture and replace war material at a much greater rate than the South could. In fact, the South's ability to manufacture the tools of war was so limited that it relied to a certain degree on war material from Great Britain, which had to come by sea and make it through Federal blockades of southern ports.
Ultimately, the South, having fought effectively and bravely, was overwhelmed by the North's ability to replace men and war material to carry one the fight--this was a war of attrition, and in that type of war, the one who has almost unlimited supplies of men and supplies wins.