In 1861, the northern states had a population of twenty-one million. The southern states had about nine million people, three and a half million of whom were slaves. Throughout the war, the South had to worry about a slave uprising, a fear that the North frequently promoted.
The North was also much more industrialized than the South. It produced over ninety percent of the country's textiles, metalworks, and nearly all the firearms. The North was also much more connected by train, having over twice the density of railways. This meant that the North had a larger pool to recruit soldiers and the ability to outfit them and move troops and supplies quickly and efficiently.
Despite the greater population in the North, the Confederacy was able to recruit an army of nearly equal size at the outset of the conflict. This was likely because the cause of the war was more personal to many Southerners and it was mostly fought on Southern soil. However, the North was able to replace casualties much more quickly than the South due to the larger population.
The Confederacy had two major advantages over the Union. The first was home-field advantage. Most of the war was fought in the South. The familiar terrain and shorter supply lines meant that the South had certain advantages while strategizing and executing battles. When they took the war into Northern territory at the battles of Antietam and Gettysburg, the Confederacy suffered two of their greatest defeats.
The other advantage was in military leadership. The South had much better generals than the North. Robert E. Lee was able to command the Army of Northern Virginia for the entire war, while the North had to frequently replace inept generals who seemed incapable of quickly ending the conflict when they had the chance. This frequent change in leadership was damaging to morale and created confusion in the ranks of the Army of the Potomac. Meanwhile, the continuity of leadership in the South made for a more organized and effective fighting force.