Our relationship with cockroaches is long-­running and unbalanced. They are pests, but not often deadly ones. They’re not technically parasites because they don’t feed off our bodies, as bedbugs do. Nor are we symbiotic, because one side (ours) doesn’t get anything out of the relationship. Instead, we are commensalists: They benefit, we don’t. They do provide minimal services to us, notably cleaning up decaying material by eating it. (They have for a long time; the excrement of one Cretaceous cockroach, preserved in amber, suggests that they fed off dinosaur dung.) And they are meals for animals up the food chain, like lizards and birds.

It’s impossible to know exactly how the Japanese cockroach made it to New York. The most popular early speculation was that it came across the Pacific in the roots of a plant. That is a theory with flaws, since the High Line’s plantings are from nurseries in the United States. Odds are that these cockroaches made the trip in a shipping container, aboard a slow-moving freighter, which establishes P. japonica in a long tradition. Three hundred years ago, a sailing vessel was an excellent place for a roach to hide out: loaded up with food, abundantly equipped with dark, slimy crevices, and inclined toward warmer waters. In the Age of Exploration, they made their way around the world. Sir Francis Drake inadvertently took a shipful of cockroaches back to ­England after capturing a Spanish vessel off the Azores. Galleons took other species from the Philippines to the Americas.

The German cockroach did not come from Germany. The Germans—off-loading the responsibility—call it the Russian roach, though it’s not from Russia. The Russians call it the Prussian roach, because it is believed to have spread across Europe in the breadbaskets of the Prussian Army, but it’s not from Prussia either. It almost certainly came from Southeast Asia, likely tagging along with the pigs that European sailors brought with them for food. As for American cockroaches, they came over from Africa to the Caribbean on trade ships, possibly even on slave ships, and then, when those ships reloaded for the next leg, made their way to Europe and mainland North America.

By the nineteenth century, roaches were almost universal, and rapacious. An entomologist traveling from England to Australia in the 1830s on a cargo ship loaded with cheese reported that some cases in the hold were half-empty on arrival, their contents eaten by cockroaches. The author David George Gordon (The Compleat Cockroach) reports that in 1908, a researcher saw “ships come into San Francisco … with the sailors wearing gloves on their hands when asleep in their bunks, in a desperate effort to save their fingernails from being gnawed off by the hordes of roaches which infest the whole ship.”

It was a golden age for vermin. There was an incredible amount of blattarian sustenance around: piles of horse manure at every curb, garbage unbagged in open barrels, an outhouse in every tenement’s courtyard. Cities like New York were a lot dirtier—and organically dirtier, with earthen floors and wooden structures everywhere—than they are now, and slum neighborhoods were unimaginably dense with people and their effluent. People tried everything to get rid of insects, from sorcery to traps baited with jam and beer to a trained roach-snuffling hedgehog. (Gordon quotes the story of a Victorian householder who tried this and found that the hedgehog got so fat he could no longer squeeze under the closet door to hunt.) The one thing that consistently got cockroaches out of clothes or bedding was dumping boiling water on them.

Only when pyrethrin, a strong general-purpose insecticide, arrived in the late 1800s did the tools for eradicating roaches get better. The ability to kill accelerated in the mid-twentieth century, when, in the space of just a few years, roaches had to contend with effective new pesticides, principally malathion, chlordane, and the inorganic standby known as boric acid. Better sanitation helped. So did other changes you’d never think of, like refrigeration and packaging: Before the twenties, most people bought food from open bins and barrels, and sealed boxes made a huge difference. There’s a reason Cole Porter, in “You’re the Top,” name-checked cellophane as a brilliant creation on a par with the Louvre.

The catch, of course, is that roaches reproduce often and in volume. Evolutionarily, they fight back against many poisons and baits almost as fast as we can come up with new ones. Only boric acid, by virtue of its inorganic compounds and simple action—it irritates roaches’ stomachs, and its grains abrade their bodies—does not cultivate resistance. By the eighties, when chlordane was banned over possible carcinogenic effects, many termites and roaches didn’t respond to it. A colony found in the U.S. House of Representatives building turned out to be the superbugs to end all superbugs, resistant to nearly all known poisons. (The descendants of those congressional roaches, cultivated in labs, became an entomological standard on which new insecticides were tested for roughly twenty years.) The best tool homeowners have today is Combat. But a study last year found that some roaches have even evolved to find glucose—which used to be Combat’s main bait—bitter rather than sweet, so they avoid those traps.