Voltaire wrote "Candide" as a satire of the then-prevalent philosophical optimism advanced by Gottfried Wilhelm Leibniz. Voltaire, moved by contemporary events like the Seven Years' War and the 1755 Lisbon earthquake, felt that optimism was a naive way of viewing the world.
In the 18th century, Gottfried Leibniz developed a philosophy that had a great influence on the thinkers of the day. According to his philosophy of optimism, all events are for the best because God is benevolent.
However, natural and human disasters of the mid-18th century, including a devastating earthquake in Lisbon, Portugal and the carnage of the Seven Years' War, led Voltaire and other philosophers to reconsider optimism. Throughout "Candide," Voltaire deconstructs optimism by juxtaposing its ingenuous tenets with the horrors of reality.