If a planetary population's social order is too low, it will enter a state of civil war. Planets undergoing civil war have a special red “!” icon overlaid on the map. Civil wars occur on a planet-by-planet basis; there is no such thing as an empire-level civil war. When a planet revolts, a large portion of ground units stationed on it will join a hostile faction called the “rebels”. Imperial Guards, produced under the Law & Order doctrine, will never join rebels.
Every so often, rebels will automatically attack remaining ground units or your forces will counterattack the “rebel base” on the planet (the rebel base is not an actual structure). These attacks are mechanically different from normal ground combat. If all your loyalist forces on the planet are destroyed, after an unknown period of time the planet will leave your empire and become independent. If your ground forces strength is roughly 4x that of the rebels, the planet cannot go independent.
Civilians will periodically join the rebels, increasing their ground forces strength. If you are able to increase the planet's social order, sentiment will turn in favor of your empire. Sentiment can be monitored from the News tab. Once your ground units have defeated all rebel units and sentiment favors your empire, the state of civil war will end.