I had a birthday card from my wife one month or so before her affair started that said "I love you very, very much". I asked her the same thing you did, "so were you lying when you said that in the card" and I got nothing more than a blank stare.
It's because waywards "compartmentalize." Their affair, which usually goes against the grain of their base system of morality (well, HOPEFULLY it does, anyway, otherwise we married the wrong person!), gets "shut off" in this one compartment in their mind, and the rest of their lives -- being a mother or father, a friend, a sibling, a good employee, whatever -- is walled off on the other side of the partition. The two cannot exist at the same place and time without a total meltdown, so the adulterer will get very adept and moving back and forth between the two "rooms" as much as necessary to continue to carry on the charade. My wife described it as a "voice" inside her head, telling her that what she was doing was wrong, but she was able to silence the voice sufficiently to continue in the wayward behavior. As I increased the pressure (by various means), she said the voice got louder and louder and LOUDER until she finally had to confront it, because she couldn't shut it out any longer. It was then that she broke down in TRUE remorse, and beggged me to take her back.