There are lots of bullies out there who will hurt you if they can get away with it. Some of them are official cops. Some of them are unaffiliated shitstains.
If you are armed, they will think twice about starting shit.
The Black Panthers knew this. That's why they went armed to patrol the police. (Then people who were afraid of the Black Panthers passed laws to stop that.)
Protests without armed people "turn violent", by which we really mean, cops go nuts and beat the shit out of people.
Protests with armed people tend to keep the cops restrained, and they have significantly less injury and death.
The weapons serve as a deterrent. Because bullies think they can win in a melee, but they don't want to be killed, and their targets are showing that capacity.
I don't like it. I wish we could have peaceful protests without the cops going wild. I wish we could have peaceful protests without the clowns who want to freak out starting fires and robbing stores.
But humans are what they are, and those risks are there.
There are, of course, risks. If coming armed becomes normal, we could have firefights in the street.
Right now, the balance seems to be that people mostly choose not to escalate. I don't know how long that will last.