The Deutsche Demokratische Republik was run as a police state, with as many as one-sixth of the population working as internal security, spies, or informants against their neighbors.
The lifeblood of the East German Police State was the Ministerium für Staatssicherheit; colloquially, the "Stasi."
You can tour the old Stasi Headquarters today. It's preserved as the Stasi Museum with a mix of preservation of the old office setup, cold war espionage and security artifacts and gadgets on display, propaganda, accounts of prisoners and rights activists, accounts of resistance action and how goods promoting freedom and democracy were promoted in East Germany, and accounts East German culture.
You can learn lessons from the museum about how the Stasi and related officials kept the government together and kept the population under control:
1. Idealistic moralistic underpinning, given as creed: One of the things that struck me most about the Stasi Museum was a poster with a "10 Commandments of German Socialism" of sorts. It had a mix of requiring you to be good to your fellow man, promote socialism, obey your parents... and be willing "to use all of your resources and energy to combat the enemies of socialism." All of it is painted as paradise coming on, and you must do your part. These were regularly repeated as mantras and creeds.
2. Lack of real ethical insight and discourse: In real ethical discussions, people are forced to think things through from different perspective and get honest debates going. Oftentimes, real ethics require difficult thinking. In false ethical discussions, you repeat slogans without thinking through the implications. East German Intelligence Officials, Security, and Propaganda tried to reduce every decision to an easy one -- support East Germany, support International Socialism, and fight against everyone everywhere else (the capitalists, imperialists, fascists, etc).
3. Threats to state security from mundane places: The places they monitored were "normal" places -- not conspiratorial at all. Many East Germans didn't want to be in East Germany, and didn't want to live under the rule of the oppressive East German government. Knowing that, the Stasi looked to get people who were upset when they were doing daily life -- at school, at the office, and so on. They tried to break up dissent before it could become organized or conspiratorial against them. Once people are being fully cautious and on-guard, they could do a lot of damage against the state. Getting people before they could build the starts of an organization meant they didn't have to fight organized and well-equipped opposition.
4. Sowing distrust among the population: With the high number of informants and security personnel, you couldn't trust anyone. Knowledge is incredibly useful and precious -- and it's very expensive to acquire on your own, and relatively inexpensive to acquire by sharing with like-minded people. The Stasi successfully discouraged a lot of open sharing of information by making people wonder who all the informants are. Honest and open dialogs with free information exchange aren't possible when you can't trust anyone.
5. Equivalency of the government and the nation/people: A German friend explained to me, "Americans are funny. They can love their country but hate their government. Germany is different, we associate the government much more with the country. It's been like that for a very long time, which is what made it easier for the Nazis to gain power, and later for East Germany to function. Americans seem to often distrust authority just because it's authority. It's the opposite here." The East German government certainly actively fostered the opinion that the government was the active embodied will of the nation; that the government was the nation.
6. Stick-based incentives: West Germany rapidly became more appealing than East Germany. More freedom, more wealth, better quality of life, less paranoia, less social control, and so on. East Germans left in droves for the West, which prompted the building of the Berlin Wall. Faced with such a strong incentive to go West, the East German government created incentives not to go: the punishments could be very high. From being shot or killed trying to scale the wall to being imprisoned, losing your job, being blacklisted, and even having your family and friends retaliated against if you left, they tried to create a strong sense that attempting to leave East Germany was a very bad idea.
7. Get people invested and conditioned early: East Germany had a wide variety of "youth organizations" which over 90% of the children wound up joining. They'd start receiving ranks, orders, honors, and awards for behaving appropriately in line with the State's expectations early, which helped condition them to stay as part of the system later. The Party recruited members early and had a high participation rate, which both conditioned people to accept it as normal (even if you disliked it, it seemed incredibly common and you knew many members). And doing it this way made it treasonous to oppose the Party later.
That was the crux of their plans -- create a religious-like set of slogans, discourage honest ethical discourse and instead have people spout creeds, police mundane areas for even minor dissent before it became organized, sow distrust of people among their neighbors, indoctrinate people that the government and officials are the people and nation itself, put a world of hurt on people who try to disagree or dissent, and start signing up young people as early as possible to feel like they're actively participating in the system and part of it.
My German friend's parents escaped from East Germany to the West about six years before he was born. His mother had been imprisoned for two years, and two him stories about prisoners being interrogated, beaten, tortured, and raped -- sometimes for simple dissent against the state, and sometimes even just by having a powerful person who disliked you and was able to set the wheels of East German "justice" grinding on you.
I asked why more people didn't rebel. He shrugged off the question a number of times, but I re-asked different scenarios of looking to overthrow that sort of totalitarianism. Finally he answered:
"People here are cowards. They like rules and want to follow the rules, even if they're stupid or evil. Americans don't understand it, Americans hate being told what to do and don't trust authority. Germans want to trust authority and follow the rules and be good people."
Maybe there's truth in that, or maybe not. But in 1989, the people of East Germany had had enough, and tore down the wall and threw out the Stasi bureaucrats that had ruled them.