means that
an opponent's tactics may sometimes be countered by using similar methods. The saying is not a blanket justification for harmful retaliation.
also
You cannot fight fire with fire
The saying “Fight fire with fire” can be used when you should fight your opponent by using the same methods or weapons that the opponent uses.