The professor should be explaining these things to
us, not the other way around.
But yeah, they have a kind of built-in GPS system in their heads to find their way back to their original nest, even across thousands of miles. Obviously only a one-way delivery system.