Most parents who are dealing with divorce do know that the children aren't a part of what is being torn down during the process. Though it's not true in every case, often, both parents want to continue having a relationship with their children. At the same time, emotions can run high, and it's easy to slip into behaviors that put the kids in the middle of the battle.
When divorce is especially bitter or custody and other legal battles go awry, it can be difficult to separate those feelings from feelings about your child's relationship with the other party. This leads to the projection of feelings onto the child's relationship, whether you are doing it consciously or not, and kids pick up on these cues. If you want to buffer your kids from the uglier parts of a divorce battle, then you'll need to ensure you fully understand how you feel about each aspect of the process so you can control those feelings and separate them from feelings about the kids and their relationship with your ex.
It's also important not to discuss certain issues and elements of the divorce case with your children. While you never want to hide the divorce from kids or pretend like nothing at all is wrong -- they know things are changing, and pretending otherwise invalidates their feelings -- you also can't use your child as a confidant and best friend during the divorce process. This is true even if your child is a mature teen or verging on adulthood themselves.
Instead of confiding in your child, talk to your divorce attorney, a professional therapist or a good friend. Doing so will help you separate issues so you can support your child in having a good relationship with his or her other parent, even if you can't.
Source: The Arcata Eye, "Bonnie Carroll: Protecting Children From The Tragedy of Ugly Custody Battles," Bonnie Carroll, accessed Sep. 09, 2016