It's not usually the cheating that affects children. It's the divorce or breakup.
More often than not adults usually don't share "the details" with small children. They don't want to take away their innocence or badmouth their spouse to them.
Nevertheless children may (sense) "something" is wrong in the household based upon how the betrayed person behaves around them.
On the other hand if their mother/father has introduced the children to their secret "friend" this may cause some confusion. Teens and adult children will find out for themselves.
Depending on what they witnessed in the household they may take either side. It's not unheard of for an adult child to empathize with a cheating spouse if they feel this person has sacrificed years of unhappiness in order to keep the family unit in tact.
If the cheater ends up marrying the other person that also changes the dynamic.
Every child and every scenario is different.