probably this...or you did; by "letting" her play on her own.
She may have found a side of herself she didn't want to see or experience (the "good wife" falling for a guy who is not her husband). And then... being rejected is not a good experience either. Anyway she decided to stay with you. That's the good part of the story.
Perhaps she just didn't want to risk your relationship again, or didn't want to go through the aftermath of another bad ending again.
- Just a few thoughts.