The North had a decided advantage over the South, both militarily and economically. The North had a much larger population from which to draw troops, had a decided advantage in heavy industry to produce armaments and had the majority of the nations railroads which could move troops and materiel rapidly. The North also had a more organized government which allowed for efficient prosecution of the war. The South had only one major foundry, the Tredegar Iron Words in Richmond, and was dependent on "cotton diplomacy" to secure aid from Europe.
The South had no real economic advantage; but enjoyed a military advantage. Commanders in the South were far superior to those of the North. Many were West Point graduates; Thomas J. "Stonewall" Jackson had been professor of geometry at Virginia Military Institute. Robert E. Lee, the Southern commander in chief had been offered that same position on the Northern side by Winfield Scott, but declined because he would not fight against Virginia, his home. Additionally, Southern soldiers were far better marksmen than their Northern counterparts. Since most battles were fought in the South, that side also had something of a "home field" advantage.
The South never had any realistic possibility of winning the war; however it did manage to prolong the war much longer than anyone had anticipated.
21 states vs. 11 states. 21 million people vs. 9 million people. In the game of numbers, it would appear at the outset that the North had the singular advantage. However, despite this deficit, the South's army was almost equal in size to the North's.
This is because the South enjoyed the advantage of morale. It was their war; they were fighting for their culture, their land, and their sovereignty. Add this to the advantage of trained officers, and you are looking at an army that had every chance of winning. The South—like the colonies in the American Revolution—was also in the defensive position. The South had the home field advantage—they were fighting on land with which they were familiar, and this gave them a marked military advantage.
In the end, though, the superior economical advantage and the numbers advantage of the North was too much for the South to overcome.