how does an animal know to perform certain crucial life actions before exposure to it?
it is built into their very being
it is taught in school
they are trained at a special school
they have magical powers