As in many countries all over the world, laws are made to prevent political opposition, well at least as long as the opposition is against the ruling class. Like what happened in France after WWII when the communist party won the majority of the votes, they changed the electoral system so that not every man had one vote but different regions had one votes. Of course the majority of the people belonged to the proletariat, like it is today, and of course the rich lived bigger and the workers lived in less spaces but were more then the rich. If you see where this is going you will see that there is impossible for real communists to actually win and keep the power and decentralize the power of the economy to the level of the working class.
S.Korea is no exception. The National Security Act is a law that forbid communists, or any kind of anti capitalist to speak about their believes. Many books are as well forbidden. With laws like that you dont have to make any frauds in elections since if you are real opposition it is illegal.
The highest punishment of breaking the act is death penalty.
The fact that they actually have laws in the south that says that it is a criminal action to visit the north without permission from the south side authorities while it is not illegal to visit the south from the north without permission neither any laws oppressing opposition in the north, gives a good view of the two societies in Korea.
Wikipedia about National Security Act
Here is a story about how you can break this absurd law