It sounds like your wife was not really there for her children either.
Your older children are grown and can plan on distancing. Your twelve year old is the one that will need your love and assurances. At this age they tend to feel that they are not loved and valued enough for their parents to stay together where they can experience a loving happy home. They simply are too young to understand the complexities and that it is not because they are not important or loved.