Public Communication
From a game theory perspective, we should expect to see protests when there are agents who wish to embed an idea in the public consciousness, and the conventional media channels are not achieving the desired goals. The points you list as downsides are actually critical elements of protest:
- Personal cost in time/travel/opportunity
- Risk of violence/injury
- Risk of arrest
- Risk of gov't crackdown (in authoritarian regimes)
Humans are constantly filtering out the vast majority of inputs their brains receive on a daily basis. Getting a message to stick is extraordinarily hard. That is why brute force repetition is the go-to solution for programming brains, and why the world's major tech services are funded by ads. You could say they are funded by brainwashing/human programming.
What a protest does is present a message with social signifiers indicating this is important. The personal cost to the protesters and the risk they face is actually a price signal for the value of their message. The costs they impose on others (blocking roads/highways all the way to full-scale rioting) signal the value they believe their message should have in the population at large. The goal of protests is rarely to effect direct change, as that almost never happens. Nobody who aims to start a protest can point to a long string of successes as justification for why people should join the protest, and yet they do, time and time again. Are protesters fundamentally irrational?
No. Their goal is not to change leaders or people in power. Their goal is to change everyone else. It is a public influence operation. It is an attempt to draw attention to an issue, signal that the issue is more important than the mass of other topics a random citizen could attend to, and to educate them about why they should think or feel a certain way about the topic. In many cases, merely raising awareness will instigate change. The success of a protest is not effectively measured by executive action taken, but rather by the degree to which the protest becomes a topic of public conversation. By getting people to discuss the matter under protest, the population is called to become members of the jury of public opinion, and humans often cannot resist this role. By debating it, people aligned with the protest have an opportunity to argue for its goals and influence those who might oppose it but for flimsy reasons (such as default alignment or general ignorance of the topic).
When leaders do respond to protests with meaningful action, it is almost never because of the protests themselves, but rather because of the response to the protests. Only when it is clear that the protest has succeeded in changing public opinion do leaders sense the winds of change and act accordingly.
Racial Justice
In the 80's, the average American did not know much about the policing of POCs, and many simply lived with the default assumption that they were treated fairly, given that there was high levels of trust in public institutions at the time; an inheritance of the general social unity formed after WW II and the decades of prosperity following. Thus, the Rodney King beating was a major shock to the American consciousness. Of course, POCs knew what the situation was like, but they were minorities with a weak voice. They did not have effective means by which they could raise awareness among the white population. Wide swaths of America simply took the Civil Rights Act as a done deal which solved the issues of race relations in America.
George Floyd was certainly not the first black person to die at the hands of police under controversial circumstances. But the protests that followed raised the issue of police brutality, race relations, disparate treatment of POCs by many institutions, and all the related issues in a way that few public campaigns had achieved in the past. There was no greater reckoning with racial tensions since the Civil Rights Era almost 60 years prior. Did the protests effect immediate change all across the country? No. Sure, there were a few outliers, such as token defunding movements in some cities. But in terms of actual change, most of it came down to corporations with a guilty conscience donating millions of dollars to BLM chapters (which itself turned out to be problematic, but that's a whole other ball of wax). The rest of the effects were more diffuse and harder to characterize. Surely there were many conversations among many folks who would never have bothered to discuss race relations had the protest not occurred. The protests forced America to discuss these issues to an extent that was not seen for half a century. That is the most powerful outcome of protest.
Social Contract
Most of the major advances in social progress have come on the heels of protest: the 40 hour work week, women's suffrage, child labor protections, etc. In most cases, long before protests occur, there are people in society who are discontent with the status quo. However, they are a minority, or at least they believe they are a minority, and they should not speak up, lest they be suppressed by the usual social forces. Protests often form when a core group of activists senses that the time is ripe to bring the discontent into the public, so that the silent majority, who wrongly believe they are in the minority, can become emboldened and see that they are, in fact, in the majority. The social contract says: "Sometimes you will not like how things are going. But as long as your life is doing reasonably well, you will stay quiet and accept the status quo. This is the price of a prosperous society." The agitators, at some point, say: "No. This injustice is too great to stomach. It is time to break the social contract and say out loud what many of us are feeling."
The media will not adopt a cause celebre unless they sense a wave of public support. So protests often break this chicken-and-egg problem by drawing attention to the issue and hopefully drawing out public support for the issue from the silent majority who are not willing to protest, but are willing to express solidarity with the protesters to varying degrees. If protesters judge wrongly and there isn't a large base of support, then the protests fizzle out. This happens often. It doesn't mean that protest itself is inherently useless or flawed. It simply means that the protesters did not judge the social conditions effectively, or simply engaged in wishful thinking, believing that they could sway a large portion of undecideds simply by making some noise. Sometimes, a failed protest serves to teach the protesters and those aligned with them the current mood of society w.r.t. the issue. Sometimes, the same issue needs to be protested periodically to sense the mood of society to detect when it shifts into a new direction.
Conclusion
Protest is the ultimate expression of free speech. It is the citizen exercising their democratic power by spending a small to medium cost to publicize an issue that they feel is important. It may involve some civil disobedience, but of a form that is mostly tolerated in free societies. It is a breach of the social contract designed to make people uncomfortable, but not threatened to the extent that they will automatically side with any suppression of the protest. It both exposes public support for an issue as well as influences those who may be on the fence, or simply ignorant of it. In many cases, awareness itself is the critical missing piece. Even if the awareness does not by itself lead to immediate change, it can have an effect through generational turnover. Sometimes, a new generation needs to gain enough awareness of an issue to override the older generations who are trying to maintain status quo.
I dare say that general knowledge of protest topics in the population at large is higher due to the protest activity itself than it would be without. I would also argue that protesters are more likely to influence neutral observers, because the people who side with the status quo are not spending any resources to defend it. The fact that protesters are willing to incur personal costs to participate in the protest is itself a strong signal of value that neutral observers will weigh. And when groups disagree on a topic, you will get both protesters and counter-protesters, and the relative sizes of the groups is a signal to society of how society at large views the topic. So while there are many right-wing demonstrations in towns all across America, there are usually much larger counter-protesters at the demonstrations. Very few white nationalist demonstrations are pulled off without challenge from counter-protesters. White nationalists are doing what all protesters are doing: trying to influence public opinion. Trying to draw out the silent majority. Trying to force a public conversation. If there is a silent majority, it is clear that they are not willing to put on their brown shirts and spray painted shields and march in their local white pride parade.
So protests serve an important role in communicating to the public how society at large views particular issues. They are like a real-time poll, with all the problems of sampling bias that real polls have. If we view them primarily as tools of communication, for spreading information about values and raising awareness, then it should be clear that protests serve a valuable public function, which is why they continue to be held.