The standard three-second spiel you get in school is "Lincoln freed the slaves". Unsurprisingly, it's a lot more complicated than that, but it's hard to get much nuance in when you have to cover two hundred years in nine months.
The Civil War began largely because the slave states were terrified that Lincoln would outlaw slavery; he had expressed only an opposition to extending slavery to the territories and new states, but given his antipathy towards the practice, their fear was somewhat justified. There was also the issue of tariffs: charging a tax on imported goods, and thus forcing the consumer to pay more. Northern industrialists wanted to protect their developing factories from cheap products brought over from England, but the South was mostly plantation-based, and didn't want to pay more for clothes and machinery. Tariffs weren't directly part of the conflict, but the argument certainly heightened the tensions between the two sides.
The banner of states' rights was certainly trumpeted as justification for secession, but slavery advocates had consistently argued for a state's right to allow slavery, and against a state's right to ban it. The Confederate Constitution did not allow a state to ban slavery, and in fact required both states and the country as a whole to protect it.
The Emancipation Proclamation did free slaves but it only covered the parts of the country that were in active rebellion; slave states that had not seceded, like Maryland and Delaware, were unaffected. Lincoln declared that this was an exercise of his power as commander-in-chief of the Union Army, and the order also allowed ex-slaves to join the military. This prompted the flight of hundreds of thousands of slaves in the Confederacy, and by the end of the war nearly two hundred thousand black men had served in the Army or Navy.
Shockingly, the Confederacy got really mad at this, and said any black soldier would be summarily executed if captured; Lincoln countered with a promise that one rebel soldier would be executed for every soldier illegally killed, and one would be put to hard labor for every soldier enslaved. (Shooting a guy who's shooting at you is just fine; shooting a guy who's unarmed and helpless is quite something else.) The threat was carried out when the Union knew about executions and slave-taking, and the Confederacy didn't exactly back off, but it didn't happen as much as you would think.
Unfortunately, being in the Army and officially having the protection of the U.S. government doesn't mean nobody's going to be a jackass. While eighty black soldiers received commissions as officers, that's a very small fraction of the number above who served, and until April 1864 black soldiers were effectively paid $7 a month, to the white soldiers' $13.
The Emancipation Proclamation, as a war measure, was inherently limited, and Congress passed the 13th Amendment, banning slavery throughout the country, to extend and solidify it.