I posted about this in on another thread recently. As someone who had an affair I think I'm drawn to these threads.
My situation was that I was emotionally unstable, and I was in an emotionally abusive relationship.
I was desperately unhappy and he wouldn't let me leave. Sounds ridiculous I know, but I felt trapped. Couldn't have my own bank account, email address, and he controlled all the decisions - Financial and otherwise. I resorted to a myriad of ways to block it out. Some harmful, some not so much. I had to lie about meeting a friend for coffee. He wanted to be my everything.
For many reasons I had an affair. I'll regret for the rest of my life the damage and hurt I caused my partner. The guilt lives with me daily and I'll never be the person I was.
I also had a complete breakdown afterwards, and now have sometimes crippling anxiety, which I never had before.
But I don't blame the man I had the affair with. It was my fault, my (wrong!) choice to have the affair. My fault my partner was hurt. The other man had his own reasons for the affair, but he wasn't responsible for my partner's hurt.
It doesn't make it right. I guess my affair enabled me to leave.