If something invisible is killing them will rats eventually recognize the danger?

Say you are a tinkerer with too much time on his hands and you decide to control rats getting into your basement by installing a remotely controlled high powered laser that will let you boil their eyeballs if they approach a sewer grate that is providing them entry into your residence.

Is there any possibility that non-injured rats are smart enough to eventually make the connection that “if I go there something will hurt me even though I can’t see or smell it” or is that impossible?

Absolutely. They don’t need to be able to see or smell anything, if they experience pain every time they enter a certain area they will learn to avoid it. Researchers frequently do this by giving rats electrical shocks.

ETA: On re-reading your post however, I’m confused as to why you think “non-injured” (i.e. rats that haven’t been that area before) would “make a connection” if they haven’t yet been exposed to the trap. Do you mean if they see their brethren getting fried will they realize not to go there?

Yes. Will other rats be able to make the connection via a pile of carcasses or other clues that their buddies are being fried and avoid the area without having been zapped personally.

It’s a very interesting question, I hope someone comes along who can answer it with some certainty. I’d be inclined to say the rats wouldn’t recognize the danger; if a load of rats who had eaten poison or contracted a disease all happened to fall dead in the same area, I doubt other rats would think, ‘lots of rats have died there; I’ll avoid that area’. Also animals in the wild don’t tend to be afraid of the sight of guns (such as elephants in serengeti); they’re afraid of the loud noise, and sometimes they’re just afraid of humans in general, but they don’t make the connection between the object and the danger unless they’ve had a bad experience themselves. My guess is that animals in general, apart from the most intelligent ones, are not clever enough to make causal connections between dead animals and a source of danger in their environment.

Possibly because animals die naturally all the time, so generally a pile of dead animals in an area would mean only that a lot of live ones hang around there. I’m thinking places like underneath bridges, etc., where you might find thousands of pigeons loitering about at certain times–surely some happen to die there too for various reasons that don’t necessarily imply danger.