In anthropology, psychology, and cognitive science, magical thinking is nonscientific causal reasoning that often includes such ideas as the ability of the mind to affect the physical world, correlation equaling causation, the law of contagion, the power of symbols, and the meaningfulness of synchronicity.
Magical thinking can occur when one simply does not understand possible causes, as illustrated by Sir Arthur C. Clarke's suggestion that "any sufficiently advanced technology is indistinguishable from magic", but can also occur in response to situations that are largely random or chaotic, such as a coin toss, as well as in situations that one has little or no control over, especially those one is emotionally invested in. (Indeed, this can be seen as a special case of failure to understand possible causes: specifically, a failure to understand the laws of probability that guarantee the occurrence of coincidences and seeming patterns.)
Sir James George Frazer and Bronisław Malinowski said that magic is more like science than religion, and that societies with magical beliefs often had separate religious beliefs and practices. The difference between science and magical thinking emerges in 17th century philosophy. Both worldviews are mechanistic and based on causality, but the scientific worldview is distinguished by the scientific method and by skepticism, requiring the falsifiability of any scientific hypothesis.