James Snyder noticed one day that a frog had climbed onto a tree in his backyard in southern Florida and swallowed one of his Christmas lights. He snapped this eerie photo in which the light glows through the frog’s stomach, like a herpetological holiday ornament.

This frog’s behavior seems weirdly stupid. But there’s actually a wisdom of sorts in swallowing a Christmas light–if you’re a Cuban tree frog, that is. For thousands of years, the only glows your ancestors ever saw on a tree came from luminescent insects. If they responded to a little glow by attacking, they got a meal. They were more likely to survive and have baby frogs. The frogs that didn’t respond? Some of them may have done just fine. But others may have gone hungry. The males might have struggled to attract a mate; the females might have laid small eggs that failed to develop.

Natural selection laid down this response in Cuban tree frogs, in other words. Christmas lights have only recently come into their lives, and natural selection has shown no sign yet of striking the “attack glowing light” behavior off the menu.

Snyder’s glowing frog is one of the prettiest examples of a surprisingly common thing that happens when animals come into contact with humans. We have altered the environment in a vast number of ways, both small and large. And when animals try to read the cues from our human environment, they can get tricked. They can end up doing something that kills them, loses them the opportunity to reproduce, or simply wastes their time. Scientists call these situations evolutionary traps.

In the journal Trends in Ecology and EvolutionIn the journal Trends in Ecology and Evolution, Bruce Robertson of Bard College, Jennifer Rehage of Florida International University, and Andrew Sih of University of California, Davis, take a look at a lot of documented examples of evolutionary traps and try to come up with a theory for them. They would like to be able to predict when traps will occur, and find a strategy to prevent evolutionary traps from endangering species.

Some evolutionary traps, like the Christmas lights, play on the visual strategies animals use to find prey. Albatrosses will peck at brightly colored pieces of plastic floating in the water, for example. It’s a response that used to give them energy but now can fill their guts with trash. Some of the species we’ve moved around the planet are tricking native predators. A native North American wasp used to lay its eggs in a native ladybird insect species. We’ve now imported a new species, which the wasp now prefers. Unfortunately for the wasp, the defenses of the alien ladybird are so strong that it can kill the wasp’s eggs.

Evolutionary traps can even fool animals looking for a mate. In Australia, male beetles of the species Julodimorpha bakewelli, are attracted to the gleaming brown surface of female beetles. Beer bottles, it just so happens, look a lot like female Julodimorpha bakewelli, and so male beetles can often be found furiously trying to mate with them.

Artificial light can set evolutionary traps not just by creating the illusion of prey, but by throwing off an animal’s navigation. When caddis flies become adults and are ready to mate, they need to get to a body of water. Without Google Maps to help them, they do what their ancestors have done for countless generations: they take advantage of the fact that ponds and streams change the reflection of moonlight, altering its polarization. Unfortunately, large plate glass windows can polarize light in the same way, with the result that caddis flies will sometimes blanket the glass, mate, and lay their eggs there.

Sometimes, an evolutionary trap is fairly harmless. Cuban tree frogs don’t swallow Christmas lights that often, and Snyder found that his hapless visitor was actually still alive and eventually spat out its mistaken prey. But in other cases, a mistake can be catastrophic. Some beetles lay their eggs in fallen trees. If they make the mistake of laying their eggs in trees that people have cut down for lumber, their offspring will end up dead in a mill.

These evolutionary traps can be especially dangerous when they’re more attractive than their natural counterpart. Beer bottles, it turns out, throw male beetles into a mating frenzy, because they have exaggerated versions of the visual cues on female beetles. Super-attractive traps lure away a greater fraction of a species to their doom. Robertson and his colleagues surveyed 445 scientific studies of evolutionary traps and found that 86 percent of the severe ones involved this combination of danger and heightened attraction.

The scientists also ranked the ways in which we humans create traps. Invasive species top the list. Next comes agriculture and forestry. Some birds, for example, usually prefer to build their nests at the edges of forests, so that they can fly a short distance to find food in open spaces. These birds are attracted to thinned forests and the edges of cleared land. Unfortunately, so are mammal predators that eat them. Buildings and roads create traps, as well as artificial lighting that goes with it. Sea turtles that lay their eggs on beaches near hotels may head inland instead of going out to sea, fooled into thinking hotel lights are the moon over the ocean.

Ironically, evolutionary restoration projects can also create evolutionary traps for the very species conservationists are trying to save. To increase the eggs laid by Coho salmon, conservation managers have attracted the fish to streams where farmers later draw down the water for their crops. The salmon that hatch from the eggs get stranded and die.

Any explanation of evolutionary traps has to account not just for why some species fall into them, but why so many don’t. Fortunately, there’s been a lot of research on how animals respond to different stimuli, and so Robertson and his colleagues have adapted these findings to the question of when evolutionary traps work. They predict that evolutionary traps are more likely to work the more they resemble a cue animals relied on in the past–especially if that cue was reliable. Some cues are especially important for animals to respond to, the scientists also point out. Rejecting them can have disastrous consequences. If an ecological trap resembles one of these essential cues, animals will be less likely to reject it.

Once animals fall into a trap, they may go in one of two directions: escape or doom. Some animals may be able to learn from experience that a cue they used to rely on now brings them grief. Of course, some lessons are easier to learn than others, and some animals are better at learning than others.

Evolution can also spring animals from an evolutionary trap. If an animal is born with genes that lower its preference for a cue, it may be less likely to die–and more likely to pass on its genes. Even if animals don’t evolve this new behavior, they may still persist. There may still be enough good habitat where they can reproduce, so that their entire population doesn’t get sucked into a trap. But if a trap is too potent and animals can’t lose their attraction to it, extinction is a real risk.

One way to reduce that risk is to get rid of the trap. Take away the beachfront lights that fool sea turtles, for example, or block them by restoring sand dunes. Move lumber out of forests before rare beetles try to lay their eggs in them.

It’s also possible to take away an evolutionary trap’s allure. Solar panels, for example, turn out to be very attractive for aquatic insects because their polarized dark surfaces resemble water. But scientists have discovered that all it takes is a thin white border around a solar panel to make it unappealing to the insects.