They do this to scare regular folks from not participating in protests. Because good and honest people will stay home if they worry about getting hurt.
The goal of the police is to make protests undesirable and that's what they do.
Undercover cops, for example have been video taped in many instances of breaking store windows abd starting fires. The goal being to give ab excuse for police to disperse crowds.
I know many don't believe me but veteran protesters under this. Go to a protest and find out for yourself.