The answer is a bit more complicated than one might imagine, or the popular conceptions would suggest. Arguably, there are a couple different answers for the antebellum period, the initial days of the war, and then later on in the war. Michael P. Johnson's Towards a Patriarchical Republic: The Secession of Georgia[0] weighs the internal class conflict that helped precipitate secession. Keri Leigh Merritt's Masterless Men: Poor Whites and Slavery in the Antebellum South[1] is another fascinating read on the subject that I'd heartily recommend along with Manisha Sinha's The Counterrevolution of Slavery: Politics and Ideology in Antebellum South Carolina.[2] Finally, James McPherson's wonderful Battle Cry of Freedom[3] touches on these matters throughout the book, albeit from a more general perspective.

There's no question that poor southern whites and yeomen farmers both saw their wages depressed by slavery and recognized it as the direct cause of their woes. In the antebellum South--particularly during the two decades leading up to the Civil War--there was a significant class conflict that that represented a clear internal conflict to the planter/master class. Not only was the number of slaves increasing, they were also starting to be used in non-agricultural industries. And even when they weren't, slaves were a constant threat to poor white workers' efforts to try and push for wage increases as slave-strikebreakers.[4] Northern abolitionists repeatedly highlighted this conflict and hoped to use it to create division in the South; in 1838, Charles Olcott of Ohio famously observed "[a]ll of the evils of slavery are great evils; but one of the greatest is, that it injures the free as well as the enslaved."

In the years leading up to secession, the master class embarked on a major propaganda campaign to get poor whites to overlook the class conflict and see themselves as beneficiaries of slavery, and later, secession. They argued that abolitionists and "Black Republicans" would force freed slaves to be viewed as the equal of whites, to the latter's everlasting detriment. The common points were that black emancipation would flood the labor market and depress wages for poor whites to starvation levels, the ensuing class conflict/race war would kill thousands of those whites who didn't starve to death first, and of course, there was the constant specter of miscegenation. James Furman, a South Carolina Baptist preacher, predicted that "[a]bolition preachers will be at hand to consummate the marriage of your daughters to black husbands...submit to have our wives and daughters choose between death and gratifying the hellish lust of the negro!!...Better ten thousand deaths than submission to Black Republicanism" (McPherson).

None of these attitudes were new. Fear of a slave rebellion had been a constant in slave states, and it touched slaveowner and yeoman alike; non-slaveowning whites figured they'd be at risk just the same as slaveowners. Then John Brown attacked Harpers Ferry in 1859, and the worry about hypothetical slave revolts turned into an orgy of fear and paranoia; the master class saw an imminent threat, with non-slaveholders in cahoots with Northern abolitionists even as non-slaveholders felt the same fear. John Brown was tried, and as the North started to lionize the man as a martyr and saint, the South went nuts in anger. McPherson likened the Southern panic in 1860 to France's Great Fear in 1789.[5] These arguments clearly had a profound impact on Southern society, and were embedded so thoroughly that they'd be lodged in the collective Southern psyche for the next century. But alone, they weren't enough to push through secession.

For the master class, secession was seen as both a means of protecting the peculiar institution and eliminating the internal threat posed by poor whites. The propaganda and constant fear helped lay the groundwork, but they succeeded mainly by managing to push through before internal opposition could solidify and organize. They were also helped by poor whites being apathetic voters, as they knew they lacked the power of the master class. In the end, secessionists pulled out all the stops to ensure nothing could stop the movement:

> The ultimate choice of disunion, therefore, was a choice made by the master class. By the early 1860s, the Deep South’s slaveholding interests were using every possible method to force people with no ties to slavery to support the institution. Politics became dominated, as Shugg wrote, by “farce and fraud; the knife, the sling-shot, the brass knuckles determining ... who shall occupy and administer the [public] offices.” Poor whites, along with many other non-slave owners, made it completely clear that they opposed disunion. The state conventions, of course, were all dominated by the master class, who deliberately chose to ignore public will. While proving the efficacy of manipulative violence, slave owners simultaneously invoked more concern from Northerners. To Americans residing in free states, it seemed as if a small but powerful band of slaveholders were the only Southerners desiring disunion. Poor whites certainly did not want war. They had no desire to fight and die to protect an institution that had long injured their own prosperity and well-being. Despite all of the weight scholars have afforded white supremacy, it was simply not enough to unite the white South over slavery and disunion (Merritt, 303).

Once everyone accepted that war was inevitable, both sides tried to downplay slavery as the immediate cause. For the North, it was to avoid antagonizing the border states. For the south, it was because they needed a more palatable rationale for non-slaveholders to accept. The Confederacy also expected King Cotton to persuade European governments to quickly support them, but they figured avoiding mentioning slavery would give foreign governments a useful figleaf to hide behind on slavery. It was a complete fiction, but a useful one for each side. And in 1861, everyone believed it would be a short war. Southerners believed that their martial superiority would carry the day, and one Southern soldier could whip a dozen or two Yankees.

Some fought because of cultural beliefs about courage and the glories of war or the fear of the shame of cowardice (or the physical threat of hanging deserters). Others because the immediate enemy--Northerners--was a more tangible threat than the political power of the planter class. But at first, that wasn't a huge issue. In 1861, "almost half of all the South’s enlistees 'either lived with slaveholders or were slave owners themselves'" (307). That changed later on with conscription, the "Twenty Negro Law" (in part, tied to the fear of slave rebellion), and the hiring of substitutes who were mostly poor. And throughout the war, desertion was a constant challenge for southern armies. Eventually, the Confederacy would try to limit some of the class tensions that were hampering the war effort, but even after, they were always a factor. Finally:

> The master class’s fear mongering surely helped convince a number of them that maintaining slavery would keep their families safe and their wages stable. By playing to their basest, most irrational anxieties, masters suc- cessfully used racism to push reluctant poor whites into an unsustainable war. Moreover, many of these men, who oftentimes lived hand to mouth during slavery, actually looked forward to the prospect of making a steady wage in the Confederate military [...] Other poor whites were seemingly coerced into enlisting due to the fact that they depended upon certain slaveholders for employment, land rental, or loans. Some simply concluded that allying with the powerful master class was in their best interest. Yet another often-overlooked incentive for antebellum era men to join the armed forces was the historic precedent of the government granting land to veterans [...] Finally, cravings for honor and respect undoubtedly led some poor white men to try to prove their own self-worth and masculinity through combat. And once the war actually began, slaveholders could shift their campaign of racial hysteria into a campaign about honor and patriotism. Once the fighting commenced, the region’s politicians could stop talking about miscegenation and race wars and begin talking about heroism and virility. And poor white men, who had spent most of their lives without a sense of honor, finally found a way to feel valued by their society. By protecting their homes, families, and communities, poor whites were able to elevate their social status. Furthermore, as David Potter found, most Southerners had more loyalty to the war and the troops than to the Confederacy itself, largely due to their emotional attachments to “home" (318-320).

Apologies for the length, my reply got away from me.

0. https://www.amazon.com/Roots-Southern-Populism-Transformatio...

1. https://www.amazon.com/Masterless-Men-Antebellum-Cambridge-A...

2. https://www.uncpress.org/book/9780807848845/the-counterrevol...

3. https://www.amazon.com/dp/B002NXOQLQ

4. https://www.lawcha.org/2017/07/17/poor-whites-labor-crisis-s...

5. https://en.wikipedia.org/wiki/Great_Fear