Pain =/ bad (perspective forcing)
When someone enters an arena with two violating items, the security guard calls out the more flagrant one and may be more lenient with the second.
That's the thing about pain -- one (larger) instance makes it easier to feel okay about (smaller) instances. Nothing forces perspective like pain. One may ruminate on one frustrating situation -- until another (more) frustrating situation comes along. Depending on one's 'past vs future' orientation, a string of thoughts can look like ruminating on situation A to ruminating on situation B (and so on).
A high-pain event really 'puts things in perspective.' This is one reason emotional charge decreases in adults as they age. Old people rarely get emotionally charged about small things -- because they look small compared to situation Y (friend passes away) and Z (family member passes away). Being confronted with death (experiencing arguably the worst pain possible) changes the relationship someone has to everyday events and annoyances. It's difficult to ruminate on situation A when 'there are more important things to be upset about.'
But why doesn't this always happen? Why do high-pain events sometimes create perspective? And other times turn someone into a bitter old man (a Scrooge-like character seeing only the negative in the world)? It's unclear -- one trend is that spirituality seems to play a role in many people's 'perspective'-maintaining. After death, people seem to find peace in the idea that 'there is a bigger picture or purpose to it all' (a purpose that transcends death). Spirituality helps people zoom out past death. The 'perspective' becomes wider and wider as the emotional charge about every-day events decreases.
Without this belief in a higher power or 'purpose,' it's easier to fall into patterns of negative thinking -- a 'life is meaningless and painful' stance. With 'negative thinking' glasses on, small disturbances become amplified. The viewer sees the negative and ruminates on situations A, B, and C (perhaps to avoid thinking about the awful truth of situation Y and Z). There are two ways to respond to death -- acceptance and denial (in reality, it's probably more like a gradient). Denial needs distractions (and alternative thinking or emotional charges to distract oneself from the pain). Therefore, negative thinking plays an important role in bringing us out of a painful reality (it's another form of escapism that people desperately need after confronting death.