Karen Adolph, from the NYU Action Lab, has done a series of very elegant studies in which she demonstrates how infants learn through experience when it is safe to crawl or walk down a step, over a gap or down a steep slope.
Infants with some crawling experience will happily crawl down a low step or pile of pillows.
But when confronted by a higher drop off, will usually decide that it is safer to turn around and go backwards.
In this set of video clips Karen demonstrates how infants use information from the environment to decide what is safe and what is not. What is particularly interesting is that once infants start to walk, they need to relearn through experience what is safe.