An "emotional affair" takes place when someone initially opens up about their feelings concerning their current relationship/marriage with an outsider. Over time sympathy and empathy eventually give way to flirting and sharing laughs.
I suspect the majority of "emotional affairs" take place online or long distance. Distance is what keeps them from becoming "physcial affairs".
The truth is there is no "real way" to protect your marriage from one because the only person any of us has control over is ourself! All you can do is strive to keep the lines of communication open with your partner and take their concerns to heart. Continue to be affectionate, considerate, and passionate.
When a person feels as though they can't talk to their mate about things that bother them or they don't believe their mate will make an effort to improve things then they are ripe for an affair of some kind.
Just because you're married does not mean one stops listening, reassuring, showing appreciation and making sure their mate knows how special they are in your life. Whenever a person feels taken for granted or ignored it's not difficult for a stranger to put a smile on their face and in their heart.