If a State A attacks another State B's military apparatus knowing full well that

Read another response by Jonathan Westphal, Andrew Pessin
Read another response about War
War
If a State A attacks another State B's military apparatus knowing full well that there will be civilian collateral damage, then why is it that even if State B retaliates by intentionally targeting civilians, it's terrorism?