IMO people in happy relationships rarely have affairs. I’m not saying it’s a good thing or it’s ok, but I do believe this to be the case.
Depends how you quantify what a "happy" relationship is. In m experience, "happy" has usually meant "what the cheating partner feels they're entitled to".
So, yeah, if the fact you're suddenly no longer as young and lithe as that adoring girl (or guy - I've known more than a couple of those too) causes the cheating partner to feel resentment, then I guess that relationship is, indeed, "unhappy" from their point-of-view.
Or if you're no longer as bouncy or spontaneous as when you were teenagers, because, you know, we've got responsibilities now.
Or they don't get your full attention like they did, because, you know, kids need your attention sometimes too. Yeah, I've seen how that's made some feel that they're no longer "making each other happy".
Bar a few, miniscule, special circumstances, most affairs have been performed by someone wanting to escape. But the cause of them wanting them to escape hasn't necessarily what we, here, would empiracly judge an unhappy relationship. It's been (all real examples) because they couldn't handle the stress of their partner's cancer diagnosos and treatment, or work becoming too stressful, or a parental bereavement or just plain having kids.
Basically life became tough and they wanted to escape. I get that. just the way they chose to self-medicate was through adoration of someone else or a saying their hard circumstances justified and entitled them being selfish "just this once".