Sleep is a Slippery Thing
For as long as I can remember, I've had insomnia. I've never stayed awake all night (not even when, as an experiment, I deliberately tried to do so) and I don't have trouble sleeping every night. My insomnia, therefore, is mild. But still, sleep is something I have to work at.
If the conditions aren't right, then I have trouble falling asleep. I need to be in a familiar place. I need a book to read, or else music I like on a playlist or an interesting radio piece. Boring reading doesn't help me sleep, because either I don't read it, or the effort to read it is enough to keep me from relaxing. But if I think something too interesting, it'll keep me up as well. And worrying about being sleep-deprived is almost the worst thing I could do.
Part of it, undoubtedly, is executive functioning. I have a poor time sense, so I may easily stay up too late without realizing it. And my difficulty shifting attention extends to difficulty 'turning my mind off' when I need to sleep. Giftedness also plays a part in this, since gifted people often have very active minds. Sensory processing issues are also relevant - the 'princess and the pea' problem.
But I think a bigger part of it is trauma.
I can't remember the sexual abuse I suffered. I know it happened (for one thing, one of the culprits confessed), I know I used to remember it, and I can feel it in my instinctive beliefs and feelings, but I can't remember it. Still, from what I've pieced together, I know at least some of the abuse happened at night.
I had an alarm on my door, to stop my cousin from getting in. He figured out tricks around it, such as making it look like I'd wandered out and set the alarm off that way.
I was afraid of the dark for a long time, to the point where I needed my bedroom light on. Now, I mostly keep a light on to read by, but if I let myself think about it, the darkness still scares me somewhat. Every shadow becomes an enemy creeping towards me. I can't just close my eyes or they'll get me.
If I have an argument with my parents late at night, I can't sleep until we resolve it. Even if that means them not sleeping. Unfortunately, sleep-deprived parents aren't as good at calming down their child, so this tends to be extremely unpleasant.
But despite all that, most of the time I sleep well. I have my routine and it works. And once I get to sleep, I get the joy that is dreaming. Many of my best ideas have come from dreams. Even nightmares give me a glimpse into my own needs, and some of them become interesting (though emotionally intense) stories. And when I wake up, I feel like myself again, ready to go out and deal with the world and all its excitement.