The Ashley Madison hack—a web site for those seeking extramarital affairs—has dominated the news for the past few weeks. Some 32 million account holders were exposed when hackers posted the raw data online in August, with multiple celebrities and other important folks (pastors and prosecutors alike) hanging their heads in shame. Now there are apologies being issued and even lawsuits being filed—it’s truly a mess.

But the reality is this isn’t new, of course: Most Americans say infidelity is wrong, but affairs happen. Research indicates that about 25 people of married men and 20 percent of married women cheat.

RELATED: 8 Ways Sex Affects Your Brain

And while it’s easy to blame a lack of morals (or hypocrisy) the real reasons people step out on their spouses are far more complicated. “Most people will say that they weren’t planning on it or didn’t want it. It often happens when people aren’t looking for it,” Kristin Zeising, Psy.D., a sex therapist and couples counselor in San Diego, California, explained to Health. It doesn’t make it any less hurtful or wrong. But this means that, most people don’t make a calculated decision to cheat. Rather, relationship or life troubles bubble over time, and then, well, an opportunity presents itself that by then seems irresistible.

Zeising shared with us the most common problems that can lead to infidelity down the road.

Feeling unsatisfied with each other
It’s a cliché because it’s true. “Unsatisfied” might mean you’re not sexually in sync with your partner or that you’re unhappy in the relationship, but either disconnect may make you or your partner more likely to cheat, suggests 2011 research from the Archives of Sexual Behavior. The study found that 72 percent of men and 62 percent of women who cheated said they weren’t happy in the relationship. And 74 percent and 48 percent of cheating men and women, respectively, said they weren’t sexually compatible with their partner.

“For both men and women, there’s an emotional component to cheating,” Zeising said. “They may feel a lack of connection, affection, or not feel appreciated by their partner.”

To help affair-proof your relationship, it’s important to be honest with each other about your needs and desires, express your feelings, and show your partner they matter to you.

RELATED: 10 Reasons You're Not Having Sex

A wage gap
People that bring home the bacon—and have a partner completely dependent on their earnings—are more likely to be cheated on, per a new study in American Sociological Review. It may be one way the non- or lesser-earning spouse evens the stakes in the relationship. Men, they discovered, took the inequality the hardest, making them more likely to stray, compared to women.

As with all things money-related, communication is key—even if that means simply airing built-up resentment. When you figure out the source of the frustration, you can deal with it in a way that makes you and your partner happier and work out your expectations for the relationship. (Rather than letting it stew under the surface.)

Coming up on a big birthday
How many candles are you getting ready to blow out on your cake? A 2014 study published in the Proceedings of the National Academy of Sciences looked at anonymous data provided by a dating site “for people who are already in relationships” (they didn’t specify whether it was Ashley Madison), and found that, for men ages 25 to 64, there were 18 percent more users whose ages ended in “9.” The authors speculate that those on the verge of a big birthday are more likely to search for meaning—and sometimes that meaning is found in an extramarital affair.
Having ways to problem solve effectively will help you buffer those changes. For example, the researchers also found that recreational marathon runners entering a new decade ran faster race times, so people may channel anxiety about big milestones in productive ways, too.

RELATED: 10 Ways to Improve Your Relationship Instantly

Boredom
“This is a really common reason people cheat. One survey found that 71 percent of men and 49 percent of women cheated because they were bored,” Zeising said. It’s sad, but true. Plan activities that create novelty and adventure (like vacation!), and the sexual excitement can follow, she says.

Feeling unsatisfied with yourself
Sadly this isn’t one you can fix for your partner, but it is one you can watch out for in yourself. Whether it’s an ego stroke, an effort to feel better about yourself, or a desire to feel attractive during a midlife crisis, people cheat because they’re looking outside for validation in the wrong place. “This is an inside job. Think about what is going on for you that you need to address rather than searching for someone external to make you feel better,” Zeising said.

RELATED: 20 Ways to Fall in Love All Over Again

Hope after infidelity
“We can never guarantee we won’t be cheated on,” Zeising said. If cheating does happen, Zeising has seen some relationships bounce back in it’s wake. “It can open up the door to address problems in the dynamic of the relationship,” she said. “I’ve seen relationships grow stronger.”

This article originally appeared on Health.com.