Infants develop an avoidance reaction to the appearance of depth by the age of 8 to 10 months, when they begin to crawl. This discovery was made on the surface of an apparatus called the visual cliff. The latter is a table divided into two halves, with its entire top covered by glass. One half of the top has a checkerboard pattern lying immediately underneath the glass; the other half is transparent and reveals a sharp drop of a metre or so, at the bottom of which is the same checkerboard pattern. The infant is placed on a board on the centre of the table. The mother stands across the table and tries to tempt her baby to cross the glass on either the shallow or the deep side.
Infants younger than seven months will unhesitatingly crawl to the mother across the deep side, but infants older than eight months avoid the deep side and refuse to cross it. The crying and anxiety that eight-month-olds display when confronted with the need to cross the deep side are the result of their ability to perceive depth but also, and more importantly, their ability to recognize the discrepancy of sitting on a solid surface while nevertheless seeing the visual bottom some distance below. Both nervous-system maturation and experience contribute to this particular cognitive advance.
source: Encyclopedia Britannica