Note that some countries have scripted events named "civil war", for example the English Civil War. These events are intended to represent some historical civil wars. However they are not true civil wars; they are normal events, typically involving some rebellions and some event-imposed revolt risk for a while.
Effects of Civil War
The effect of a civil war is fairly drastic. Each of the country's provinces (even colonies and trading posts) has a 33% chance to become rebel-controlled. This happens regardless of its level of fortifications. Each of its armies has a 50% chance to defect and become a rebel army; this includes having its leaders defect with their army, turning into rebel leaders. Fleets do not defect. (Passengers can defect; you can drop them off in any port.)
Causes of Civil War
The check for triggering a civil war happens only once per month, at the start of the month.
The cause of a civil war is low stability, and high badboy, and being at peace. You will never get a civil war if at +1 stability or higher, and you won't get one when you're at war. Centralization seems to affect it - the higher it is, the lower the chance to get a civil war. Beyond this, not much is known. Civil wars are rare enough that they are hard to test. I've spent two hundred years at subzero stability without having one.
The effect of badboy on civil wars is not all or nothing. You can get a civil war with zero badboy. However, high badboy makes them much more likely.
In 1.09, if you attempt world conquest, civil wars are now a very serious problem. They will now happen very frequently on very hard for any country over the badboy limit which is at peace, and at less than +1 stability. The incidence in this circumstance is unknown. Anecdotally, civil wars may happen something like one every four months, although I have personally seen no civil war for over a year when just mildly over the badboy limit. Perhaps only very high badboy causes very high incidence. Obviously, research would be necessary to determine exactly what's up here.