In the book "Thinking fast and slow" by Daniel Kahneman, it is claimed that there is a growing body of evidence that we really have two brain systems. A fast one, which uses heuristics to quickly approximate the answer, and a slow one, capable of deliberate and rational thought. He argues that the fast brain system is really responsible for a lot of our cognitive biases.
For example, our fast brain does not really understand probability. It only knows three categories: either something is impossible, it is possible, or it is a certainty. A lot of human behaviour with regards to probability can be explained by this simple assumption.
Why do people buy lottery tickets? For their intuition, it moves an impossibility into a possibility. The fast brain system that fuels their intuition does not care what the actual probability is and does not understand anyway.