The immediate cause of the War Between the States was the bombardment of Fort Sumter, in the harbour of Charleston, SC, in April 1861. As a result of this, President Abraham Lincoln of the United States called for volunteers to serve three months in the militia, in order to suppress the insurrection. A military conflict with the seceding states became inevitable at that point.
But why did Fort Sumter have to be bombarded?
Between December 1860 and February 1861, seven states seceded from the United States, as they saw it reclaiming their sovereign rights. However, the federal government controlled things like the naval, military and postal services. The question of to whom these belonged would obviously be controversial. In the case of military installations, the presence of a garrison meant that attempts by local or new authorities could be resisted, at least for a time. This is what happened at Fort Sumter.
But why did these states secede?
In November 1860, a split in the Democratic party between northern and southern wings assisted in the election of the Republican party's candidate for president, the aforementioned Abraham Lincoln. Lincoln's party had a plank in its platform stating 'we deny the authority of congress, of a territorial legislature, or of any individuals, to give legal existence to slavery in any territory of the United States'. The question of whether slavery could be permitted in the parts of the United States that had not yet acquired statehood, much of which had been organised into territories, had been extremely controversial before the election/ In the case of Kansas, a mini-civil-war had raged for some years. All the parties took a position on this. The Democrats split over the question of slavery in the territories, with the Northern faction wanting to limit it on the basis of 'popular sovereignty': if the representatives elected to a territorial convention voted to abolish slavery in its territory, slaveholders would have to abide by that. By contrast, the Southern Democrats wanted the right of slaveholders to their human property to be respected in all territories, regardless of local sentiment. Lincoln's election, and even more significantly the election of Republican majorities in the House of Representatives and the Senate, gave slaveholders little hope that in future their right to human property would be respected in the territories. Inevitably, as 'free soil' territories became states, Slaveholding power within the legislature as represented by members of Congress would dwindle. This would open the way for abolitionists to end slavery altogether in the United States.
Thus, the fundamental cause of the civil war was slavery. However, one can argue a secondary cause of state's rights, on the basis that the outcome of the civil war established, by main force, that states have no right to secede from the Union unilaterally. They can only secede if the federal government assents to their departure. But, in the absence of the controversy over slavery, it is hard to see why that right of state sovereignty would have been asserted. Given an opportunity to claim it over tariffs in 1832-3, no state considered that issue significant enough.