Why do hermit crabs go into their shell?

They go into their shell because something might of scared them. They do it for safety in case there's a predator near by.