No recovery in sight, but I was just qurious wether the EA caused XW to fall out of love with me or the EA was a result of her falling out of love. (egg or chicken)
I think that, in order to answer that question, you'd need to know exactly how the affair started. Are you ever likely to know that now?
When it is a wife who has the affair, an affair usually starts because her love bank balance is low, in the way that markos described above. In that situation, it is very easy for a man - at work, for example, or a former boyfriend with whom she chats on social media, or the husband of a friend, or a man in the local neighbourhood committee - to show the woman attention that meets one or more of her most important emotional needs.
It could be that a man in her workplace shows an interest in her life and thoughts, and listens and asks the right questions when she talks, thus filling her need for intimate conversation. Since working people often spend more time with each other than they do awake with their spouses, workplace affairs are especially common, and easy to carry out.
The man at work, or at the pub or the gym, might show her that he finds her attractive; we had a poster on here whose wife started the affair when her fitness instructor complimented her on her new hair colour. That might sound trivial, but if her husband wasn't noticing her efforts to look nice, or wasn't complimenting her on them, then, in a dull marriage, someone else doing so can have a powerful effect.
It could be that another man shows an interest in the things that the wife is passionate about, from recreational activities (we've had many affairs that took place with running partners, karate trainers and hiking partners) to neighbourhood concerns; see how Sue, in the book
Surviving an Affair (which I hope you have read), got involved with a man on the committee for the upkeep of the lake in their area.
The connection can be made very easily when the husband is not interested in the things that the wife is interested in, and the couple pursues their separate interests, and ends up living a significant portion of their lives separately. The connection can take root easily between work colleagues who spend long days together, and even more so if they take lunch together, have after-work drinks, or worse still, go away to conferences together.
However, we have known affairs where a spark takes root in a marriage that is otherwise good, where the love bank balance is not low at all. This is more likely to happen when the husband has the affair, as men are more likely to have affairs for sex (and there is no limit to the number of women a man can find sexy). The woman that the man is having the affair with probably began having it to get her needs for conversation, admiration and affection met (affection can encompass compliments, and gestures like flowers and cards), but the man having the affair quite likely learned to meet the woman's needs for conversation and admiration so that he could get his needs for sex met, with a woman that he found attractive.
So, there are typical patterns, and atypical patterns (for a married woman to hook up with a man in a car park just for sex, for example; that is highly atypical, but it has happened here, a few times), but they might or might not explain what happened with your wife's affair.
This does matter. The conditions that led to the affair - conditions in the sense of opportunity, and in the sense of love bank vulnerability - need to be understood if a marriage is to be secured against an affair in the future.
Even if there has never been an affair, a married couple needs to guard against affairs happening, by not doing things such as becoming friendly with someone from the opposite sex; going for coffee, or lunch, or sharing a car journey, with a colleague. But when there has been an affair, the particular circumstances need to be understood, so that the vulnerabilities in that particular marriage can be overcome.