I think it comes down to if you respect yourself, and you respect your spouse.
Low self esteem, giving them an excuse to get validation elsewhere.
Feeling disconected with their spouse, growing apart, stress, busy lives.
Poor self control, and thinking their spouse is responsible for all their issues in life.
If you have poor self control, no impulse control, and are weak minded and can justify hurting the one person that should be safe with you then that's what a cheater thinks.
Ultimately it's selfish, they are lost in the moment, and have no regrets until the consequences arrive. They believe they are owed some sort of magical connection, validation or rescue from unhappiness, or a perceived lack of attention or affection from their spouse, so they get that quick dopamine hit from cheating. It has all the warm fuzzies a new relationship does, and they get to hide behind their insecurities and have their cake and eat it too.
It's the ultimate betrayal, PTSD, and gives lasting trauma that never stops giving. Cheating is just a cheap excuse for bad behavior.
Being ignored, not heard, your partners flaws, not being validated, not enough attention, feeling lonely, lack of intimacy, communication, or wanting to be desired give a cheater plently of emotional validation to carry on, without a care in the world.
If they weren't WEAK people they would fix the issues, or they would leave in a healthy way. Unfortunately there are plenty of people out there that are willing to join them in the destruction of your life. Many probably feel the risk is worth the reward, right up till the point when they lose everything. When that happens regret sinks in, and they have a sudden epiphany that they want it all to go away and you to forgive and forget like it was nothing.
The biggest hipocrates are the ones that would be 1000 miles away if you did it to them, and it would be unconscionable for them to be the one that was betrayed.
In the end they often have issues with communication, and healthy boundaries. No one cheats by accident. Lots of steps take place where they could walk away and say NO, but they don't.