Knowing the hallmarks of an emotional affair might be easier than answering why they happen. I think, in the simplest of definitions, life gets in the way. Kids, job stress, house renovations, arguments about the house renovations, boredom ... all can make us vulnerable to emotional infidelity. You've dated the same man, married him, had kids and perhaps now the sheets are not necessarily steaming anymore. Does telling someone outside your relationship, whom you happen to be attracted to, make that better? I highly doubt it.
I mentioned slippery slope earlier and it's exactly what Gary Neuman talks about in his book, Emotional Infidelity. The reason it's dangerous, according to Neuman, is because "Once you have an emotional infidelity, it can make the jump to someone else's bed a whole lot closer." And doesn't that make sense? You start sharing the frustrations of your current and primary relationship with a third party, they lend a sympathetic ear, a shoulder to cry on, and who knows where that may lead.
So how do we safeguard against emotional affairs? Again, ideas from the book Emotional Infidelity, though you might think them a bit extreme. Neuman suggests finding polite ways of ending personal conversations, not sharing personal feelings, not meeting outside the office. Does that mean if I have a death in the family, I can't share with that person? While I won't go that far, I must admit some of his tips make sense, like being unflinchingly honest with yourself. When you think about that person, do those stupid butterflies start jumping around in your stomach? Do you dress in the morning with him in mind? Hm... Time to, in the words of Dr. Phil, "Get real."