Multiple possibilities. One reason for cops to do this is to give themselves an excuse to escalate the amount of violence they can use against protesters. Or as bait to rile up other protesters to follow their lead and then the cops who are close by or even the undercover regime officers quickly swipe the protesters away.
It is a tactic commonly used by the IDF against Palestinians: Israeli undercover soldiers seen arresting Palestinian protesters
Or they might simply be disguised to perform actions which would be illegal for the police while remaining masked and unidentifiable.