My DiL's father died when she was 5, but he is still part of her, and now her children's, life. They know that Grandpa B has died and have probably visited his grave as DiL still lives locally and usually leaves flowers on it on key dates..
DGS is three and a half and is obsessed with knights. dragons and everything scary. Over Christmas after a family walk up Dragon's Hill, a local viewing point he assured me that he had seen a dragon and the dragon there ate grown ups like Mummy and Daddy.
When, half-laughing, I asked him what would become of him if the dragon ate his mummy and daddy he said, with absolute confidence that Grandma and Grandpa (DH and myself) would be his Mummy and Daddy and, while obviously, it was lovely to see his confidence that we would always take care of him, it did occur to me that he also understood the concept of death and that it was permanent. He understood that his other Grandpa would never return and also that if a dragon ate his Mummy and Daddy, they also would never return.