We all sit up and take notice when the unexpected happens — whether it's meeting an old friend on the street, or a close call while driving. Babies are no different. In fact, it turns out the element of surprise has a big influence on how babies learn new information about the world around them, according to a new study by researchers at Johns Hopkins University.

Eleven-month-old babies were presented with different scenarios — like a ball rolling down a wooden track or thrown through the air. In some situations, the ball behaved the way it normally would: For example, it stopped at the bottom when it hit a wall. In others, the ball appeared to go right through the wall (actually going through a concealed hole) and continue on the other side.

Babies seem to come preprogrammed with basic knowledge about the physical world. But just like adults, when things happen that don’t quite fit into their understanding of the world, it draws their attention, and makes the event stick in memory better.

When the team tested the babies to see what they knew, by linking a sound to the ball, the babies who’d seen the predictable ball showed no evidence of learning the association, but those who’d seen the “magic” ball quickly learned to associate the sound with the ball.

They were also a lot more interested in playing with the “magic” ball than they were in playing with toys they had never seen before.

Most intriguing was that the infants did little “experiments” of their own on the unpredictable balls — for instance, banging the disappearing ball on the table, as if trying to understand it or testing its solidity.

Babies who’d seen a different unpredictable event, like the ball appearing to hover in mid-air, did similar “experiments” also closely related to the situation. These babies tended to drop the balls, as if to see whether they responded to gravity.

“The infants' behaviors are not merely reflexive responses to the novelty of surprising outcomes but instead reflect deeper attempts to learn about aspects of the world that failed to accord with expectations,” author Aimee E. Stahl said in a statement.

“Infants are not only equipped with core knowledge about fundamental aspects of the world, but from early in their lives, they harness this knowledge to empower new learning.”

Indeed babies do seem to come preprogrammed with basic knowledge about the physical world — for instance, that objects can’t pass through one another and that gravity pulls things down. But just like adults, when things happen that don’t quite fit their understanding of the world, it draws their attention, and makes the event stick in memory better.

The attention-getting quality of novelty may be the reason why curiosity is so important to learning no matter what age you are. When we’re compelled and intrigued by what we’re seeing and experiencing, it makes learning that much easier and long-lasting.

The study is published in the journal, Science.