I think there's definitely a sample bias in studies of cohabitation and divorce. People won't live together before marriage for moral reasons are more likely to believe that divorce is wrong, and a couple should stay together no matter what. So it's not an issue of causality - cohabiting doesn't cause divorce - but rather that people who are more likely to choose divorce are more likely to cohabit, and the other way around.
However, the trap of cohabitation is when the couple doesn't agree on what it means. If you have one person who thinks moving in together is the next step on the way to marriage and kids, and the other thinks that it's mainly a way to save on rent, then at some point a few years down the line, the marriage minded partner is going to realize that they aren't going to get what they want. But by this time, they've been living together for a few years and breaking up is going to be a huge hassle. Ultimately, they can end up with all the heartbreak and difficulty of divorcing and separating their lives, without ever having actually gotten married.