When an animal learns something very fast because a certain event occurring at the right time manages to trigger the learning process, it's called imprinting.
Here's something almost hard to believe:
Soon after hatching, if baby ducklings see a cardboard box pulled by a string passing by, they'll follow the box as if it were their mother. Moreover, as the ducklings grow up, they'll continue following the box. They just do not catch on...
These ducklings have been born with the instinct to follow the first thing that passed by. The moving cardboard box appeared and triggered the response of following the box. The ducklings thus imprinted on the box.
It's easy to see how ducks could have evolved in such a away that this strange situation could arise. In nature, the first moving thing any newly hatched duckling sees is nearly always its mother. In a sense, Mother Nature found it easier to program the ducklings to "follow the first moving thing passing by" than to "be smart enough when you're born to be able to recognize your mother."
This strategy worked beautifully for millions and millions of years -- until sneaky scientists came along with artificial incubators and cardboard boxes pulled with string!