Fundamentally, what prevents anything is not doing it. Of course it's much more complicated than that due to our thoughts, feelings, and emotions. The root cause of divorce is not getting a divorce, but often differences that are perceived to be irreconcilable. When there are "irreconcilable differences" it suggests that we think differences need to be reconciled.
In my honest opinion, this is not always the case. Everyone is different and we shouldn't attempt to control others, especially our spouse, and if we do try to control them then maybe our differences are not the problem, but our inability to accept them for who they are.
So perhaps the answer is to accept our spouse for who they are before getting all in a twist about their alleged flaws and shortcomings. If we love someone we will find a way to keep no record of their wrongs.
After all, it is the grace of God that keeps us coming back, these second chances, that let us know that not all is lost when we failed miserably. When we give this kind of grace to our loved ones it gives them a reason to reflect and make the choice to be better. That is the miracle and mystery of grace.