From experience, the children understand far more than you think. Essentially, though, an attack on either parent...verbally...is an attack on how they perceive themselves.
They will see, hear, and understand everything...and as they mature, will evaluate your actions on their own.
Being a good parent is not about forcing your will because you feel you can be a better parent than the other. You will have to accept a different situation...and you can't protect them emotionally always. You have to be consistent, calm, and open to listen and talk to them. They will express to you what they are feeling only if you allow yourself to listen...and not get defensive or offensive about their other parent.
Your objective is to give them the tools they need to cope... I am far closer to my children now because I was able to realize this early on...and I assure you it was very very hard in my situation to meter my comments about certain situations they were going through.