During the so-called Age of Enlightenment in the 18th century, European intellectuals came to believe strongly in the power of reason as the mechanism for controlling the world. The scientific method flourished. Ideals like liberty, progress, constitutional government and separation of church and state came to the forefront. At the onset of this time, Isaac Newton introduced his laws of motion, including the law of universal gravitation, which explained how the whole solar system operated. This set the stage for the concept of a clockwork universe, which became popular especially in deist circles.

The idea of the clockwork universe sees the world functioning like a mechanical clock wound up by God, ticking with precision, its gears controlled by the law of physics. This kind of well-oiled machine would be quite predictable. 

Imagining the universe working like clockwork was a thought that fit well within deism - a philosophical stance asserting that god doesn’t directly manage the affairs of the world, keeping a distance. While it rejects dogma, revelations and miracles, deism says that you can get to know the existence of the creator through reason and by observing the natural world.  

Gottfried Wilhelm Leibniz, the inventor of calculus and calculators, was a strong proponent of the clockwork universe theory. In a letter to Leibniz, the English philosopher Samuel Clarke described well, if perhaps with a bit of attitude, how the theory views God and man’s fate: 

"The Notion of the World's being a great Machine, going on without the Interposition of God, as a Clock continues to go without the Assistance of a Clockmaker; is the Notion of Materialism and Fate, and tends, (under pretence of making God a Supra-mundane Intelligence,) to exclude Providence and God's Government in reality out of the World."

Indeed, the clockwork universe theory has no place for free will and random behavior described by quantum physics. Still it’s not inconceivable to think that the world is some kind of machine - perhaps a simulation like Elon Musk proposes.