According to an online conspiracy theory, the American author Dean Koontz predicted the coronavirus outbreak in 1981. His novel The Eyes of Darkness made reference to a killer virus called “Wuhan-400” – eerily predicting the Chinese city where Covid-19 would emerge. But the similarities end there: Wuhan-400 is described as having a “kill‑rate” of 100%, developed in labs outside the city as the “perfect” biological weapon. An account with more similarities, also credited by some as predicting coronavirus, is found in the 2011 film Contagion, about a global pandemic that jumps from animals to humans and spreads arbitrarily around the globe.

But when it comes to our suffering, we want something more than arbitrariness. We want it to mean something. This is evident in our stories about illness and disease, from contemporary science fiction all the way back to Homer’s Iliad. Even malign actors are more reassuring than blind happenstance. Angry gods are better than no gods at all.

In Homer’s Iliad, the Greeks disrespect one of Apollo’s priests. The god manifests his displeasure by firing his arrows of contagion into their camp. The plague lasts nine days, brief by modern epidemiological standards. When the Greeks make amends and sacrifice sheep and goats to Apollo, the plague is cured.

Dean Koontz's novel 'The Eyes of Darkness' (1981) made reference to a killer virus called “Wuhan-400”

Seven centuries later a plague struck Periclean Athens, killing a quarter of the city’s population and setting the city-state on a path to military defeat at the hands of Sparta. Thucydides, the Athenian historian, has a simple explanation for the epidemic: Apollo. The Spartans had cannily supplicated the god and he in return had promised victory. Soon afterwards, Sparta’s enemies started dying of the plague. Hindsight suggests that Athens, under siege – its population swollen with refugees, everyone living in unsanitary conditions – was at risk of contagion in a way the Spartan army, free to roam the countryside outside, clearly wasn’t. But this thought doesn’t occur to Thucydides. It can only be the god.

Between then and now there have been prodigious advances in medical science. We understand contagious disease vastly better, and have a greater arsenal of medicine and hygiene to fight it. But in one respect we haven’t advanced at all. We still tend to see agency in our pandemics.

Disease has no agency. Bacteria and viruses spread blindly where they can, their pathways facilitated by our globalised world. We, meanwhile, bring to the struggle our ever-improving drugs and hygiene. With Covid-19, experts insist, your two best bets are: wash your hands often, touch your face never. But people do not warm to the existential arbitrariness of this. Just as the Peloponnesian plague was seen as evidence that the gods were angry with Athens, so HIV was seen by a deluded minority as God’s judgment on homosexuals. Of course, HIV spreads wherever it can and cares nothing for your morals or sexual orientation.

This attribution of agency is clearest in the many imaginary plagues science-fiction writers have inflicted on humanity. In place of gods we have aliens, like those in Alice Sheldon’s chilling and brilliant short story “The Screwfly Solution” (1977). A new disease provokes men to begin murdering women en masse. At the story’s end we discover an alien species had introduced a brain infection so that the human race will destroy itself and the aliens can inherit the emptied planet. It’s a story about what we now call “toxic masculinity” and it says: it’s not gods we have angered, but goddesses.

A scene from The Andromeda Strain (1970), directed by Robert Wise. Photograph: Universal/Kobal/REX/Shutterstock

Sometimes the alien plague is less picky. In HP Lovecraft’s The Colour Out of Space (1927; recently filmed, starring Nicolas Cage) an alien infection arrives via meteorite, wastes the land and drives people mad. In Michael Crichton’s The Andromeda Strain (1969) potentially world-ending contagion falls from outer space. This bug repeatedly mutates as Earth’s scientists try to combat it. We’re doomed – or would be, if it weren’t for the tale’s germus ex machina ending, in which the alien spontaneously mutates into a benign form.

If it’s not aliens behind our world-threatening plague, then it is probably that other SF stalwart, the mad scientist. Dozens of zombie franchises start with a rogue scientist infecting the population with a genetically engineered bioweapon virus. In Frank Herbert’s The White Plague (1982) a geneticist, pushed into insanity by the murder of his family, creates a pathogen that kills all humanity’s females. A cure is eventually found, but not before the world’s population balance has been shifted to leave thousands of men to every woman.

In Joanna Russ’s feminist masterpiece The Female Man (1975), “Whileaway”, a gender-specific virus has wiped out all the men, creating an effective utopia for women left behind, procreating by parthenogenesis and living in harmony. By the novel’s end it is hinted that the man-destroying plague was actually engineered by a female scientist. Never mind the antibacterial handwash: it is patriarchy that we need to scrub out.

So characteristic is assigning agency to pandemics in today’s culture that a video game such as Plague Inc (Ndemic Creations 2012) styles its players not as doctors attempting to stop the spread of a pandemic, but as the sickness itself. The player’s mission is to help their plagues spread and exterminate the human race. In HG Wells’s seminal War of the Worlds (1898) and in its various modern retellings, including Independence Day (1996), the virus is on our side, destroying alien invaders that lack our acquired immunity.

One of the most striking twists on this conceit is Greg Bear’s novel Blood Music (1985). A scientist, angry at being sacked by his lab, smuggles a virus out into the world in his own body. It infects everybody, becomes self-aware, and assimilates everybody and everything to itself: human beings and their infrastructure melt down into a planetwide sea of hyperintelligent grey goo. It sounds unpleasant, but it’s actually a liberation: the accumulation of concentrated consciousness, our own included, punches through a transcendent new realm. The plague becomes a kind of secular Rapture.

The mad scientists of Channel 4’s Utopia hope their germ will wipe out humanity. Photograph: Collection Christophel/Alamy

If on some level we still think of contagion as the gods’ anger, these stories become about how we have angered the god – about, in other words, our guilt. When Rick Jaffa and Amanda Silver planned their reboot of the Planet of the Apes franchise, they decided an agent, a neuroenhancer spliced into simian flu, would both raise the apes’ level of intelligence and prove fatal to humans. The resulting movie trilogy (2011-17) was more than just a commercial hit; it proved an eloquent articulation of broader environmental concerns. The few surviving humans move through the film’s lush rejuvenated forestscapes, compelled to confront avatars of humanity’s generational contempt for the natural world.

The plague that has destroyed us has uplifted these animals, given them wisdom, and they are angry with us – why wouldn’t they be? It’s a common genre trope. The scientist in Alistair MacLean’s The Satan Bug (1965) is an environmental fundamentalist who hopes his germ will wipe out humanity. The mad scientists from Channel 4’s TV drama Utopia (2013‑14) and Margaret Atwood’s Oryx and Crake trilogy are both driven by the same animus.

Having invested ourselves with the crown of all creation, coronavirus arrives to puncture our hubris. Think of the computer intelligence Agent Smith in The Matrix (1999), played with sneering panache by Hugo Weaving: humans, he tells Laurence Fishburne’s Morpheus, are incapable of developing a natural equilibrium with their environment: “You move to an area and you multiply and multiply until every natural resource is consumed.” In this telling, we are the virus.