In your context it's galvanic isolation: the center tap of a Y-output transformer is isolated from the grid (as are the phases). To re-reference the phases back to earth, the neutral is staked into the ground. This is not universal though, in some countries the systems use isolated earth (mains floating relative to the earth conductor, but also relative to the physical ground you're standing on). There's no weird physics here.