Such objects could be either beneficial or dangerous, depending on whether they decided to serve their creators or turn against them, either of their own volition or through the black arts of others.

We now live in a world where objects once again have life. We can talk to them and they can answer back, as is the case with Alexa and Siri and their digital kin. With their help we can control and organize the world around us: We can make sure our homes are safe, turn lights and appliances on or off, summon a taxi or order food from a restaurant. Little by little we are transferring to these technologies the tasks that we used to do ourselves, and at the same time, we are giving them control over our surroundings.

The internet of things is made up of billions of everyday devices connected for convenience to the web. Last fall, hackers attacked this network, commandeering as many as 100,000 of these devices by using malicious software that guessed at their simple, factory-set passwords, and then ordering them to send volleys of nuisance messages to the computers of a company called Dyn, which functions as a sort of switchboard for the internet. That was enough to cripple many major websites, including Twitter and Netflix. We have given life to these things, but now we know that they do not obey only us.

There are alternative interpretations of the Moche ceramic paintings, and some researchers do not see a sinister component. But the paintings have an echo in a myth collected in central Peru in the early 17th century. In the myth, the sun dies, the world is plunged into darkness and household objects and domesticated animals revolt: Mortars and grinding stones eat people, and llamas drive humans.

Andean people before the conquest created a philosophical and spiritual system built around the concepts of duality and transformation — light versus darkness, order versus chaos.

The modern world is full of such opportunities for chaos, often created by humans and the increasing sophistication and technology-centeredness of modern life. A solar flare has the potential to disrupt electrical networks. A tsunami can flood a nuclear reactor. The digitalization of stock markets leads to flash crashes. Russian hackers stealing Democratic Party emails seek to influence an American presidential election.

Order gives way to chaos. The internet of things turns on its makers.

The Moche culture collapsed around A.D. 850. The reasons are not clear, but the collapse was most likely a result of the Moche’s inability to cope with a hostile and perhaps changing environment, including the failure of their technology, knowledge and institutions to help them overcome those challenges. We can be certain that the technology they created did not rebel against them. But neither did it save them when they needed it the most.