To clarify Lost I absolutely do think that some affairs happen because of relational difficulties, but that this is never the sole cause. And I think the vulnerability that is ever-present in every affair is the unfaithful partner's individual risk of infidelity.
So, when an affair happens, the couple has to work out how significant that individual vulnerability is and if there were others, i.e. relational, lifestyle and social. The whole thrust of my argument is that a holistic approach should be taken to infidelity.
WRT relational vulnerabilities, I always suggest that couples think hard about what for them, constitutes a "good" marriage, because I think it is far too easy to turn the spotlight on an infidelity-blighted marriage and find risk factors and discord, that would be found in most marriages for some of the time - and in greater quantity and severity in some marriages that haven't suffered an infidelity crisis.
If on the other hand, the discord was severe and the intimacy (not just sex) was impoverished, then it would be ridiculous not to count that as a risk factor. But it's never the only one, because many people in dire marriages nevertheless have a personal barrier to infidelity, based on their own personal or moral code.
I have always said that while a happy fulfilling marriage is no insurance policy against infidelity, it will always provide a deterrent factor.
The really difficult thing I found from my own personal experience, was that I knew that our marriage had actually been at a high point before my H's affair and my H had even commented on it, the month before the OW made contact with him out of the blue. On discovery and ever since, my H was also absolutely insistent that this had got nothing to do with our marriage and everything to do with him at that time in his life. Yet, like many people, I thought that there must have been something missing, because that's how I had been socialised all my life; to think that affairs only happened in unhappy marriages.
So powerful was that discourse, for some time after discovery despite what my H was insisting and my own memories, I had trouble believing him. Worst still, because our marriage had in fact deteriorated rapidly from the point of first contact with the OW, I had been "counting" that period (a year or so) as evidence of relational discord. My H realised I was doing this and insisted I stopped looking for causes that weren't there. It was especially insightful to hear him say that not one of his justifications or permissions at the time, had anything to do with beliefs about our poor relationship. In his case, the distancing that occurred after first contact with the OW were for his own purposes in that he found it impossible to go ahead with an affair, when he still felt emotionally connected to me. Because he was addicted to the affair feelings and not the woman herself, he simply couldn't continue to get his "fix" if we were as happily connected as we'd always been - and especially had been just prior to his affair.
So in our case, we had quite a few lifestyle vulnerabilities to iron out, a few easy and minor relational issues that are commonplace in long marriages, an interesting journey about how we had both been socialised according to our gender, but the biggest issue was my H's behaviour and removing the character and personality traits that always permit infidelity.
That last bit is always the most challenging and difficult part of the process, yet IME it is invariably the one that gets avoided by couples and couple counsellors, yet it is ubiquitous in every case of infidelity.