What determines the return value of `getParent()` and how do both code paths work?