Slavery was the major driving impetus for the first seven Southern states to leave the Union. Not the only reason, but the major one. Had the Southern states not seceded, slavery would have remained legal in the United States for many more years to come before being outlawed or dying a natural death.
In what way? How was leaving the Union going to change slavery in their states? How was it going to change anything about slavery?