What would you do if a large amount of money suddenly appeared in your bank account?

For Robert and Tiffany Williams of Montoursville, Pennsylvania, this was more than a thought exercise. In May, their bank accidentally put $120,000 in their account. While nobody knows quite why this happened, we all know what the police said they did next. Instead of notifying their bank, the Williamses allegedly spent their inadvertent windfall on an SUV, two four-wheelers, and a camper, among other things. They also apparently gave $15,000 to friends who needed money.

They are facing felony theft charges—and massive overdraft fees from the bank.

“All I’m going to say is we took some bad legal advice from some people, and it probably wasn’t the best thing in the end,” Robert Williams told CNN affiliate WNEP outside the court Monday, where the couple made their first appearance in the case.

Research on human social behavior suggests that we should not be too surprised by what they did—but we also shouldn’t be too quick to draw cynical conclusions about humanity from this story.

Humans prefer fairness

Despite the allure of gratuitous wealth, exploiting others for personal profit is not considered admirable or virtuous—and, in most circumstances, getting something for nothing doesn’t feel nearly as good as earning it fair and square.

According to research in psychology and neuroscience, people are actually born with an overriding impulse to cooperate and to make choices that are fair and serve the greater good. Very young babies prefer friendly, helpful people over villains, and children routinely help strangers without being prompted or congratulated. Involuntary social isolation (e.g. loneliness, imprisonment) is inherently punishing, while having a friend close by makes challenges feel oxytocin, people form trusting relationships, and also touch each other to befriend, encourage, and console—all for the purpose of fostering and maintaining long-term, supportive social bonds. When people act generously, do something to uphold justice, or meet a shared goal, the reward pathways in their brains light up with pleasure. The tenth cranial nerve, which relays key signals between the brain and body, inherently links systems for personal calm with pathways that drive interpersonal care and affection. Worldwide, the more charitable residents of different countries are, the higher their national happiness levels are.

Humans, it turns out, are a deeply social species. Our innate “prosocial” urges to concern ourselves with the welfare of others and care about community, to enjoy being generous, and to prefer fair and equitable contexts are tied to several biological systems that have evolved to ensure our collective reproductive success.

At the same time, however, humans learn from experience and adapt to dynamic features of their physical and social settings. When we are feeling threatened, for example, our biological systems for self-preservation get priority over systems that help us socially connect.

In making decisions, we’re strongly affected by how things are framed and what’s normal amongst the people around us. Very small nudges in language can influence behavior: If a laboratory task is called “The Community Game,” people play more generously and cooperatively than they do if the exact same task is called “The Wall Street Game.” If we see others choose a wrong answer, we’re likelier to do the same than if we face the same question alone.

Given the complex array of day-to-day circumstances and choices, people tend to cost-benefit analyze their options based on things like how they feel right then and there, what they think they might gain or lose, and who’s watching—all of which, regrettably, can be surprisingly inaccurate.

Our predictions about day-to-day dangers (or how life’s plusses will delight us) don’t match what really happens. Driving to the beach is far more dangerous than sharks in the ocean, and winning the lottery doesn’t make people happier. When it comes to helping others, we mistake our self-doubt about being able to help for worry that the effort required to help will deplete us, and fail to intervene. If others are watching, we try harder; if others are there but not reacting, we take the cue to do the same, even if there’s smoke billowing under the door.

As a general pattern, people tend to over-focus on immediate threats and desires and on upholding a favorable personal and social identity. This mostly serves our safety and fluidly guides social experience. But under some circumstances, without watchful eyes or collaborative input, our brains can lead us astray.

When do we make unethical choices?

So, what happened for the Williamses? We can’t know for sure, but science suggests that several forces may have been in play.

First, the money came from a bank error not connected to a particular person—which took empathy out of the equation. If the Williams had considered the fact that their gain would be another person’s loss, they might have acted differently. This bank error issue also made it seem like nobody saw, which tends to make people less accountable. When laboratory studies give people chances to cheat in self-interest without hurting others, and without being detected, most do.

Second, people making morally questionable choices often underestimate their chances of getting caught in the long term, and fall prey to a more fleeting “cheaters high.” A bias towards thinking that we are more invincible than others, and the raw appeal of getting away with it, may have fueled the Williamses both immediately gratifying and evidence-obscuring rapid spending spree.

Thirdly, today’s constantly-on media culture incessantly promotes the idea that happiness comes from consumerism and entertainment. Mainstream channels promise genuine happiness from the fleeting pleasure that comes with new possessions, increasing status, or exclusive access to luxury—but studies show that pursuing happiness this way actually makes people less happy. It’s possible that the Williamses, like many others, believed that their new things would bring more happiness than doing the right thing.

In a related vein, we are also in an age of social-media propelled FOMO (fear of missing out), or muted resentment about how much more impressive other people’s privileges and opportunities are than our own. What better way to allay this malaise than to stock up on fancy stuff?

Fourth, the Williamses actually did do something nice—they gave away a chunk of the money to other people. Back to the cost-benefit equation, this variable likely bolstered their moral righteousness in a Robin Hood sort of way. The illusion of restoring broader fairness by giving the nameless-faceless bank’s money away to people who needed it may have countered their sensitivity to the immediate moral failure of theft.

Finally, news stories about people in positions of power behaving unethically and not having to pay the consequences have been dishearteningly common in recent days. At the same time, there is a wide chasm between sectors of society with deeply conflicting social and political beliefs, a lot of ambiguity about what is factual or “alternate factual,” and a diminishing spirit of national consensus or compromise. This combination of divisiveness and unaccountability is ideal for morally deviant behavior. Perhaps the Williamses assumed that they too would elude the very-commonly-available evidence of a giant mistaken bank deposit through denial, smokescreen, and bombast.

Put simply, we’re strongly influenced by what’s happening outside of our heads. If those influences are positive, we’re more likely make good decisions. If they’re not—if we take “some bad legal advice from some people,” as Robert Williams said—then we find ourselves on the way to jail.

Happiness and social goodness

If freely spending $120,000 doesn’t boost happiness, then what does?

According to the science to date, the most promising route to real happiness is through meaningful social connection, contributing to the welfare of others, and having a sense of purpose—in short, feeling like you matter in the world. Fortunately, there are many science-backed practices, activities, and exercises for working towards this kind of happiness.

Mindfulness, for example, helps us be more aware of real-time inner experiences and outer circumstances, in ways that reduce overly self-focused, imagined, or otherwise biased thinking, while at the same time tethering decisions to compassionate, ethical values. At the GGSC, we define mindfulness as “maintaining a moment-by-moment awareness of our thoughts, feelings, bodily sensations, and surrounding environment, through a gentle, nurturing lens”—a practice that can make you more alert to the good things and positive influences around you.

Studies also showcase gratitude—which means affirming the goodness in life and acknowledging that sources of goodness lie beyond ourselves, strengthens common humanity and healthy optimism, and binds us in trusting relationships where others help us and we lend help—as a happiness-increasing exercise.

This article was originally published on Greater Good Science.

Follow us here and subscribe here for all the latest news on how you can keep Thriving.

Stay up to date or catch-up on all our podcasts with Arianna Huffington here.