There are going to be 1000+ different reasons someone chooses to cheat on their partner.
It’s important to understand the base drive to do it in the first place, and that is the lizard brain drive to propagate our species. I’m looking at this from a males perspective, but it’s impossible to fully turn off this part of our brains. There’s always an underlying subconscious process running that evaluates a member of the opposite sex (in this case, a female) as a prospective mate. You have to remember that this is happening subconsciously. No guy (except creeps like Elon) is fully thinking “I want her to have my baby” because most of us know (without having to remind ourselves) that that’s a ridiculous thing to try and do, and something we don’t necessarily want to do. BUT, that evaluation process and resulting level of sexual attraction is still there. Our brains are so fine tuned to the process it’s why you can determine within seconds of looking at somebody’s physical appearance wether or not you’d want to have sex with them. There are of course other factors that will turn you on or off towards somebody, but that first check is always there because it can be done without interacting with them. Our minds are always looking for the next mate. 99.9% of the time it’s a fleeting thought (“girl. pretty.”) and you don’t dwell on it, but that .1% of the time you can’t overcome the allure to explore a sexual relationship it is when you start the path towards infidelity. Along the path there will be numerous checks, and it will usually fail right off the bat, but there’s always that perfect string that can land you at infidelity.
Another thing to consider is that it’s fully possible for someone to have a sexual encounter with somebody that is not their SO and have no change to their relationship from their perspective. Consider swinger couples. They have their life, their family, and occasionally they go out to a swinger party, have sex with other people, then go home and resume their lives like nothing has changed. We’ve been raised and taught all our lives (either directly or indirectly) that this is abnormal, and that once you find “the one” then that’s it. I would argue that wanting to have multiple sexual partners is the more normal experience most people feel throughout their lives, therefore forcing yourself to abstain once you’ve gotten married goes against our basic instincts. It’s a conscious CHOICE to suppress those feelings, usually out of respect for your partner and your commitment to the relationship. It may be easy for some, but there’s always going to be the others where it’s extremely difficult to always suppress such feelings. It doesn’t necessarily mean they love their partner less than someone who doesn’t cheat. Our brains are all wired a little bit differently and can behave very differently day to day and under different circumstances and environments. Even if you could filter your potential partners on Earth like a search page and distill it down to your ideal mate there would still be tens of millions of people on that list. And you will eventually run into them, and your brain will notice them, and then it’s another game of walking the path that could land you at infidelity. There will inevitably be people that reach it, and there will be any number of different factors and decisions that got them there.
You’re takeaway from this may be that “oh, so anyone who cheats is weak willed” but that’s not necessarily true because it insinuates that they could be stronger if they tried harder. Bud I’d ask you to consider things like addiction. You could look at an alcoholic and ask yourself “why do they do that?” or a nicotine user, or chronic gambler, food addict, sex addict etc. and endlessly wonder why someone would have such a “destructive habit”. The only logical conclusion is that, because of our individual brain chemistry, certain people will be predisposed to addiction while others are not. Addiction also ties into another base brain function, involving dopamine and the brains reward center. The same logic holds true for our drive to procreate/have sex. Some of us will be predisposed to cheating while others not so much.
TL;DR - It a very hard question to answer and varies case by case why someone cheats. The desire to cheat has to do with our brains and how humans are programmed. Ultimately it’s a choice, and we all have to individually weigh the consequences. Nobody is exactly the same, so it’s entirely possible to see someones behavior and not understand it yourself.