Children who are aged 4 – 6 years old have the most fear of the dark and this only tapers off by age 9. As the DNA encoded with the children starts to have environmental feedback that there are no lions in modern darkness, the fear recedes. Still, up to 5% of adults remain fearful of the dark, which can have drastic consequences for their ability to sleep. Overall, fear of darkness is yet another evolutionary trait that may have saved our lives at one point, but is no longer always relevant.
Original source: Why Are We Afraid of the Dark?