Revolutions can be seen as a result of failure in the game's economic and political core loops. When this happens it means the player have failed to balance the material and ideological desires of the different segments of the population, resulting in one or several groups deciding to take matters in their own hands. The result is a tremendous upheaval which could go very wrong -- but depending on how the cards are played, there's a chance for one to bounce back from this crisis even stronger than before.
Outright armed uprisings are rare, but nonetheless are very much threatening. There is a lot of foreshadowing and opportunity to course-correct or compensate if the player wants to avoid a revolution. Not all movements will actually be powerful or angry enough to pose a real threat. In those cases the movements won't drag the country into a pointless war with an obvious outcome, but instead bide their time until they become relevant.
Political movement
A revolution always starts with a political movement demanding some kind of change to the country's laws. The demand might be to enact something novel, preserve something that is about to be changed, or even restore something that used to exist. Any of these could end in a violent uprising if the movement is radical enough and the player fails to meet its demands.
Support and radicalism
Political movements have two major attributes to keep an eye on: their support and their radicalism. A movement's support affects how much help they would lend to enacting their desired change if you choose to go along with them, or how much resistance they put up in case of a movement to preserve a law you're trying to change. It also determines how powerful a revolution they can muster, should it come down to that.
Meanwhile, radicalism measures how likely they are to revolt if they don't get their way. A movement with strong support and high radicalism is very dangerous. A movement with strong support but low radicalism can be a nuisance but is relatively harmless: they'll work within the system, maybe organize a protest or two, but won't take up arms. Finally, a movement with low support but high radicalism might not stand much of a chance to overthrow the government on their own, but the instability caused by their ideological fervor could be damaging to the country in the short-term and might even create geopolitical opportunities for your neighbors.
A movement's radicalism originates from two sources: the number of radicals among the pops that support the movement, and the clout of supporting interest groups with approval low enough to be Angry. Since an interest group's approval originates both from the laws of your country and also how Loyal vs radical its supporters are, radical pops can potentially double their impact on a movement's radicalism. The major difference between these two factors is that when pops act through their interest groups their impact is through clout (the national share of their political strength) while direct pop support makes a difference through sheer numbers. This means populist uprisings are possible even though the affected pops don't have any real representation in the halls of power, assuming they're angry enough about their living conditions.
While a movement's demands remain unmet, any pops that belong to them will gradually gain radicals. Once the radicalism of a movement has exceeded a certain threshold it will begin organizing an armed uprising. You can monitor this progression in your outliner to see both how rapidly you're moving along the road to revolution and how far you have already gone, both determined by radicalism.
This means you can have a direct impact on revolutionary progression. Of course you can cave to the movement's demands, which will placate them and eventually cause them to disband. But you can also address the problem by identifying the troublemakers and deal with them directly: either deradicalize them by improving their living conditions, or suppressing their contrarian ways by other means.
If you manage to get the movement's radicalism under control, you can make the revolution fizzle out on its own without giving an inch.
Home affairs
Another way of keeping revolutions in check is by establishing a Home Affairs institution. By sinking Bureaucracy into Home Affairs you can more easily keep your troublesome elements in check, giving you more room to maneuver politically. As usual such an Institution can take several forms depending on what law establishes it. A National Guard can require you to take more overt, proactive steps to keep law and order, while a Secret Police is able to operate more effectively in the background.
When radical movements are met with obstacles to their revolution for a long time, there's an increasing chance that its revolutionary fervor burns out and the movement disbands.
Revolutionary country
But let's say you don't manage to placate or obstruct the political movement and the revolutionary progression boils over a required threshold. In this case an armed uprising will take a number of your states, proportional to the strength of the movement and localized roughly where its supporters are, to form a new revolutionary country. This country has the same technology as you but with some differences in laws, to reflect the ideological desires of the political movement's leadership. Furthermore, the interest groups in this new country will become marginalized if they do not support the revolution, while the opposite is true in the loyalist part of the country.
Obviously, characters supporting revolutionary interest groups will join the revolution. This includes not only interest group leaders, but also those Generals and Admirals you may have carefully nurtured over many military campaigns and who may by now be in charge of most of your forces. Even if you win against them, they won't be making it back to your country - alive, at least.
All other properties of this new country are dependent on the states they won over. If the revolution takes all your Barracks and Arms Industries, you might be in big trouble; if the revolutionary states consist mostly of Paper Mills and Art Academies, maybe you're not so worried (until your Government Administrations start grinding to a halt and your aristocracy get mad about the lack of culture workers to patronize, that is). And of course, the loyalist part of the country retains all their hard-won diplomatic pacts and treaties, while the pretender has to start from scratch.
Revolutionary play
What follows is a Revolutionary [Diplomatic] Play where the stakes are very simple: the loyalist part of the country tries to crush the rebellion, while the revolutionary country tries to swarm the loyalists. Other countries with an Interest in the region can participate in this Play as usual. It is not uncommon for countries with good relations to the country before the revolution to support the loyalists in restoring order. It is also possible for a country whose government supports the ideals of the revolutionaries to back their side. As such, a revolution might not only result in you having to fight and kill your own people, but your nation might even become the ideological battleground of Great Powers.
If the prospect of winning against the revolutionaries doesn't look good, like in all Diplomatic Plays you have the option of giving up. But rather than simply backing down and letting the revolutionaries have their way (which, to be frank, you could and should have done a long time ago if that was your intention), in Revolutionary Plays you only have an option to switch sides and take over the revolutionary part of the country in its fight against the loyalists. A daring player might decide to manufacture a powerful revolution on purpose in order to push some highly contentious laws through, though this strategy definitely straddles the line between brilliance and madness.
It's important to note that there is no potential for a “white peace” in a revolution. Either side can capitulate, of course, but a peace cannot be signed without one party pressing their war goal and annexing the other side. By the end of the revolution, only one country will be left standing.
Cost
Needless to say, while all wars are expensive, civil wars are doubly so. A quick and decisive victory with minimal casualties is the best you can hope for - a long, drawn-out war amassing casualties and devastation on both sides might result in a country so broken it will take decades to rebuild. But once the war is over, the interest groups that lost the power struggle are defeated, for a time. Perhaps during this “golden age” you will have the opportunity to effect some much-needed political change and rise from the ashes?
Losing a revolutionary war means your country loses all its territory and pops, in other words Game Over. This is something we've gone back and forth on during development, because while we do want you to be able to drastically transform your country through revolution, we don't want to encourage you to just give up if things are looking bleak because resisting means a prolonged conflict leading to a more war-torn country in the end. So pick your side, but do it carefully! Should you end up losing after all, just like in any Game Over situation you can choose to continue playing as a different country, including the political faction that just took over yours.