Most kids go through a stage in which they’re afraid of the dark. Any creaking floorboard, rustling shutter, or random bump in the night fill them with terror. Good! Here’s why, and why we should maybe never grow out of it.
It’s maybe an obvious point, but it’s not the dark itself that children find so terrifying, it’s the fear of whatever boogeyman or supine monster under the bed that made the sound to begin with. This fear, and the grinding anxiety that it generates, acts as a check and limiting mechanism against reckless behavior like, say, running around in the dead of the African night with a continent’s-worth of big cats out on the prowl. In other words, it’s an evolutionary advantage.
Remember, for a large portion of humanity’s early days, we were far from the top of the food chain. Our ancestors quickly learned that many predators prefer the cover of darkness to hunt and over time that association strengthened into a subconscious absolute: stay out of the dark because that’s where the danger is.