When faced with a law they believe to be unjust, every individual has a choice to make. They can comply with the law, either for practical or moral reasons. In the first case, they comply to avoid the difficulty and punishment that could be associated with breaking the law. In the second case, they obey the law because they feel morally obliged to obey laws, even when they believe them to be unjust. That could be because they doubt their own judgment, or because they think it is necessary to have an orderly society.
Among those who choose not to obey, there is a second choice between doing so overtly and acting covertly. For example, a soldier who is ordered to fire on civilians could choose to deliberately miss, firing near them but not at them. Alternatively, the soldier could openly refuse to obey the order at all.
When it comes to protests, you are being overt from the outset. As such, when protestors are given a legal order to desist, their only choice is compliance or overt violation of the law. Overt violation of the law is one of the strongest affirmations of a moral belief a person can make. They are saying, at the very least, that they are prepared to take responsibility for their actions within the legal system. At the same time, such civil disobedience is a direct challenge to the legitimacy of the state.
No wonder, then, that the state tends to respond forcefully – even violently – to such assertions. The person engaging in civil disobedience is asserting that their own moral code takes precedence over the laws of the land, and that it is important to assert that viewpoint, even in the face of personal danger.
Just being brave doesn’t make a person correct, however. Many people throughout history have put their freedom and lives on the line in defence of viewpoints that we now know to be based on factual errors, or which most people would now consider to be extremely morally dubious. That being said, civil disobedience is an unusually honest and direct form of participation in public policy discussion. It obliges the individual to take a stand from which they cannot retreat. In so doing, it challenges other members within the society to evaluate the basis for their own moral beliefs, and their own obedience to the law in question.