Animal brains have evolved to predict outcomes of events in the immediate environment [1-5]. Adult humans are particularly adept at dealing with environmental uncertainty, being able to mentally represent multiple, even mutually exclusive versions of the future and prepare accordingly. This capacity is fundamental to many complex future-oriented behaviors [6, 7], yet little is known about when it develops in children [8] and whether it is shared with non-human animals [9]. Here we show that children become able to insightfully prepare for two mutually exclusive versions of an undetermined future event during the middle preschool years, whereas we find no evidence for such a capacity in a sample of chimpanzees and orangutans. We gave 90 preschool children and 8 great apes the opportunity to catch an item dropped into a forked tube with two bottom openings. Children's performance improved linearly across age groups (2, 2.5, 3, 3.5, and 4 years), with none of the youngest group but most of the oldest group spontaneously covering both openings the first time they prepared to catch the item. The apes performed like 2-year-olds on the first trial, with none of them covering both openings. Some apes and 2-year-olds eventually passed the task, but only in a manner consistent with trial-and-error learning. Our results reveal the developmental trajectory of a critical cognitive ability that allows humans to prepare for future uncertainty, and they also raise the possibility that this ability is not shared with other hominids.