We believe things will go better for us than for everyone else, even without evidence to back it up.
Many people believe they're less likely than others to have an accident, lose their job, or get divorced, and more likely than average to have a successful career. Statistically, not everyone can be right. Optimism bias is the tendency to overestimate the likelihood that positive events will happen to us, and underestimate the likelihood of negative ones, compared to other people.
In a classic study, 258 college students compared their own chances of experiencing 42 future events, good and bad, with those of their classmates. On average, they rated themselves as more likely to experience the positive events and less likely to experience the negative ones. Any one person might be right about themselves, but the group as a whole can't be better off than average. The size of this bias is debated, because part of the effect measured with comparisons against the average may be a statistical artifact.
Two things combine. We think about what we do to avoid a risk and forget that other people do similar things, and an optimistic view of our own future feels better and sustains motivation. The cost is underestimating real risks, like those of smoking or not saving enough for retirement.
Source: Weinstein, N. D. (1980). Unrealistic Optimism About Future Life Events. Journal of Personality and Social Psychology, 39(5), 806-820. Debate: Harris, A. J. L. & Hahn, U. (2011). Unrealistic Optimism About Future Life Events: A Cautionary Note. Psychological Review, 118(1), 135-154. Attempts to correct it: Weinstein, N. D. & Klein, W. M. (1995). Resistance of Personal Risk Perceptions to Debiasing Interventions. Health Psychology, 14(2), 132-140.
Generic warnings tend to be read as something that happens to other people. Concrete figures ("out of every 100 people like you") help people grasp the size of a risk, but they aren't enough to correct optimism, which is quite resistant to information. That's why it helps to design so that protective behavior doesn't depend on people feeling at risk (for example, with defaults or reminders).
Related concepts