The expression is grammatically classified like a idiom. It means to be certain to produce an angry or violent reaction.
others authors comment that intended to deliberately provoke someone else in to reacting negatively.
Some basic example about the expression.
Don't tell her you don't speak italian. It is like "a red rag to the bull".