mine was an emotional affair, rather than a physical one.
my DW had had her own physical affair a few years previously, and we had been working through that together.
our relationship has always been somewhat one-sided, and although i was committed to getting over things, i got into a bit of a self-pity spiral.
i convinced myself i deserved someone to love/want me as much as i saw in other relationships, regardless of potential cost. i met someone who was also in a difficult relationship, and we got very close. i will admit that my tendency towards white knight behaviour also played a big part here.
for 6 months i justified this to myself because my DW had felt that from me (my perception), and her affair partner, and i deserved to feel the same.
over that whole period i spent a lot of time thinking about everything, and eventually came to realise that i was just being selfish, and whatever DW's previous behaviour, that was no justification.
whatever DW had done, she was committed to repairing our relationship. she was trying.
she deserved for this effort to be recognised and validated if i truly was committed to her (which i was and am).
i broke things off with OW.
a few months later, she messaged me out of the blue, and DW found the message. everything came out into the open.
we both acknowledge our own mistakes and poor decisions, and have both decided together to build a new relationship together (our DCs are also a major consideration, but are not the main driver - not for me anyway).
so, i suppose to actually answer your original question, while at the time i was convinced that DW's behaviour justified my EA, the real cause was my own selfishness at that point.
i do regret my actions.
and if my DW is just biding her time until our DCs leave home, then i'll have no cause to complain, and will have no-one to blame but myself.