A natural fear of heights develops in infants when they start crawling, at about 9 months. This avoidance of heights, as demonstrated by visual cliff experiments, is adaptive and helps to prevent the infant from falling and getting injured.
If the infant had the fear of heights before learning to crawl, then they would be less likely to explore their environment and would take less risks. This in turn would lead to avoidance of exploration and risk taking, and this would lead to a delay in the skill development of crawling. So acquiring the fear of heights via the experience of crawling is timed perfectly, to optimize skill development and protect the infant from injury.