Post hoc ergo propter hoc

This logical fallacy represents a mistaken assertion of causality. Two events, which may have no significant causal connection, are erroneously considered to represent a cause and its effect. Correlation does not equal causation.

Examples

I took 2 pills

My headache went away

Therefore, those pills cured my headache

Those pills might be responsible, but that causality can't be determined from this argument alone. This sort of confusion about cause and effect is demonstrated by the placebo effect and is a common basis for folk remedies and many basic religious beliefs.

Another example:

I prayed that I would find my lost keys

I found them behind the couch

Therefore, prayer helped me find my keys

There's no evidence that demonstrates a direct causal relationship between prayer and finding lost keys. Plenty of people have found their keys without prayer and many keys remain lost despite prayer. Yet, for those individuals who willingly accept arguments based on this fallacy, each occurrence represents another data point supporting the idea that prayer produces results.