The difference is between the unpleasant, subjective experience (qualia) and the electrical signals indicating physical damage.
A car has sensors that detect physical damage, yet it doesn't feel pain in the way that humans do. The question is, where on that spectrum bacteria, ants, and fish lie.
> Have you seen ants writhe around after being crushed or dismembered? They definitely feel pain.
Have you seen a car deploy its airbags and notify emergency services after a crash? And yet, they definitely don't feel pain. Visible reaction to a negative stimulus is neither a sufficient nor a necessary precondition for someone or something to feel pain.