All the rules for ghosts and zombies are made up and nonsensical given current scientific understandings. It just depends on what the writer decides:
- Maybe it's that the soul that created the ghost is mirrored in the physical brain, which has a decayed copy of the living person that's since diverged from the soul
- Maybe being bound to earth causes the ghost to forget its past
- Maybe the ghost is more of a shadow of the person than a soul detached from the body
- Maybe the zombie is a supernatural force piloting a dead body to do its bidding, with only small fragments of the original mind poking through
- Maybe the author really doesn't care which it is because the relationship is the only thing that really matters
The soul and the mind were once thought to be one and the same, while many didn't think the brain to be related to either. The fun part about these concepts in the modern day is that we can make them whatever we want them to be.