Women are being portrayed somewhat unfairly here, but it is understandable. However, when you put our social actions back within a biological context, what happened in this situation and many others does not seem callous, but expected. Think of the roles of males and females in terms of species survival (both in other species, and others):
Males - procreate as much as possible, with multiple partners, in order to ensure the succession of genes. Protect pack, and assert dominance over other males in order to gain prominent mating role (alpha-male). In other words, quantity of offspring/genes.
Females - ensure mating with only the most dominant males. Entrusted with the gestation and care of offspring, so mate choice becomes highly dependent on survival value. This is where the dominant male is appealing. Here, quality of genes is important.
Social mating in a contemporary sense gets pretty tricky, as these instinctual and neural-hormonal reflexes get muddied with social constructs such as love and gender roles. You have to understand, whether she knows it or not your girl (and everybody else's girl for that matter) is constantly reassessing the value you pose to her in terms of her survival, and the survival of her potential offspring. This may seem callous, but callous implies conscious intent, and this is primarily biological. If your girl cheated on you with another man 3 years into a relationship, it's because the survival value you once posed to her (which can be in terms of power, trustworthiness, dominance, leadership, respect, friendship) seemed lesser compared to the value of another.
All this heartache is avoided simply by being the person your girlfriend wants and needs; I'm not telling you to change yourself, but simply to project the best self possible, to be the cliche 'alpha-male'. Whether we males like it or not, WE are burdened with the responsibility of attraction and care, that is simply the way it is. You will always have to work to attract them and keep them, this is the way we have become the earth's dominant species. Rather than fight biology and instinct, and ascribe intention to actions, work within it. Realize what you have to do to the cliche 'alpha-male' and you'll avoid a lot of heartache.
An 'alpha-male' doesn't mean being misogynistic and rude, either. It means caring for your partner in the highest capacity possible, while still being assertive and true to yourself. Also, if you remit all assertiveness and dominance within a relationship, she will assume you're weak, thereby decreasing your value and moving on.
EDIT:
As an example, have you ever seen some hideous dude with a beautiful woman and thought "what the hell?". This cannot simply be ascribed to money, but at times it is the underpinning of high capital -power. By whatever means, that hideous male has projected a powerful, confident, and dominant self to that female, thereby convincing her that her chances of survival and reproduction are high with this male. This can be done by something as easy as a girl watching you protect a friend, pay a bill for a buddy, or speak to her friends dead-on to disarm them.