I think it's probably different for each wayward spouse. In my wife's case, she told me later (post-fog) that she KNEW that it was wrong, and that it was hurting me, but that it felt so good that she couldn't stop it. She also said she had a lot of "I deserve to be happy" thoughts, and she would remind herself of how selfless she had been as a SAHM over the years, and how now maybe it was time for her to have a little FUN in her life.
Once I exposed her affair, there were many days where raw ANGER at me motivated her to continue, but she said that she respected that I was willing to fight for her, and for our family, and that even tho she was royally PISSED at me, she knew that what I was doing, I was doing out of love.