It is their job to (1) protect the protestors from physical harm, and (2) to prevent the protests from getting out of hand like what happened in June 2020.
This is not, in practice, what they do. In reality, they tend to use overwhelming force with dubious justification (if any), escalate situations via techniques such as kettling of protestors, and arrest/brutalize people expressing their disapproval of the above. There are many instances where police use violence on nonviolent protestors, so how does that protect them from physical harm?
It's weird how 'Fix the problems that are being protested' is not an option on the table.
The answer to 'The police are indiscriminate and unaccountable in their use of violence against the public' always seems to be 'Employ even more indiscriminate and unaccountable violence against the public.' It's almost like that's the only response these institutions are capable of.