My MIL is currently critically ill, and we have been told to expect the worst within a couple of days. DD (4) knows her grandmother is ill, and in hospital, and Daddy has gone to stay for a few days. I am likely to go and join him tomorrow (we live about 60 miles away) and my parents will come and stay to look after DD and DS (2).
My plan was just not to say anything further to DD until MIL dies - it seems to be an easier message to say "grandma is dead" than explaining that she is going to die, iyswim. I worry that if you say she is going to die, she'll want to visit, which isn't going to happen, and also there's the concept of "why can't we stop it?". However, I know honesty is considered the best approach. DD is pretty bright, but perhaps a bit behind with emotional intelligence generally. She is likely to understand, but I imagine bottle it up and it will come out in challenging behaviour and sadness.
So, is it better to wait until afterwards, or prepare her now? I genuinely don't know. It's totally unexpected incidentally - we saw MIL on Christmas Day, and although she was poorly, we had no idea what was coming.