Former White House Chief of Staff John Kelly stirred up controversy when, appearing on Fox News, said “the lack of an ability to compromise led to the Civil War.”

As many historians have already noted, historically speaking, it’s hard to imagine what further compromise was available by the time the war broke out, other than the South deciding not to secede or attack Ft. Sumter—and accepting the eventual abolition of slavery. It’s not as if Congress didn’t try. Earlier decades had seen multiple compromise efforts, including most famously the Missouri Compromise of 1820.

Morally speaking, Kelly’s comments could be taken to imply that the North should have compromised with the South over slavery—a repellent view that one would hope Kelly would disclaim.

Yet the controversy also raises legitimate questions relating to the Republic itself. Without a compromise over slavery, there would’ve been no U.S. Constitution. What were the framers thinking? And was their compromise justifiable?

Southern states would not have ratified an abolitionist Constitution. Nor did Northerners—including those who personally opposed slavery—call for national emancipation during the 1787 Philadelphia convention.

The famed “three-fifth compromise,” which proposed counting each slave as a fraction of a citizen for the purposes of taxation and representation, offered one. Fugitive slave clauses, which promised a return of slaves who had escaped to the North, offered another. Such concessions are a painful historical fact. And there have always been those, like abolitionist William Lloyd Garrison, who believed they made the Constitution a pact with the devil.

The basis for the Framers’ compromise was the hopeful—and mistaken—assumption that slavery would eventually be abolished voluntarily by the Southern states as it had been by many of the Northern ones.

James Madison and his colleagues had reason to believe that slavery would die a natural death. Before the invention of the cotton gin—a machine patented in 1794 that sped the laborious process of cleaning cotton of its seeds—slavery seemed increasingly unprofitable. Indeed, Madison, Thomas Jefferson and George Washington never made substantial profits from their plantations.

Technology changed the economics of slavery—for the worse. The cotton gin vastly increased plantation owners’ potential profits, creating the incentive for more slavery characterized by ever greater brutality toward the enslaved. By the time Abraham Lincoln was elected in 1860, the Southern commitment to slavery was grounded not only in pseudo-scientific racism and religion, but also in the continuing economic self-interest of slaveholders.

The only compromise that could have headed off war by then was for the Southern states to forgo secession and agree to abolition. Conceivably Lincoln would have agreed to gradual abolition to avoid war; he certainly believed before the war began that he lacked the constitutional authority to emancipate the slaves unilaterally.

Once the Confederate states seceded and troops fired on Fort Sumter, the only solution possible was complete Southern surrender. And as the war continued, and slavery became an explicit justification for the conflict, emancipation became central to a resolution.

The upshot is that the Constitutional compromise of 1787 was based on a mistaken calculation—namely that slavery would be abandoned because of its economic inefficiency as well as its moral contemptibility. The compromise bought the continued existence of the United States as a country for nearly 75 years.

The morality of the compromise was and remains legitimately open to question. But without it, there would likely have been no Union to defend in the Civil War.

Noah Feldman is a professor of law at Harvard and the author of the new book ‘The Three Lives of James Madison: Genius, Partisan, President.’