It’s weird how I’ll see a dream and really ponder over it right after waking only for it to be completely out of my memory shortly after.
You don’t form longterm memories while asleep; you lose the last few minutes before you drop off, as well. Short-term memories are held, but they don’t get stored.
And the same applies while you’re dreaming - nothing’s getting recorded. You can pull it out of short-term right after you wake up, but that fades right out.
When you do remember dreams, it’s because you remember remembering them while you were awake. If it was vivid enough to go over hard enough, then the second-hand memory gets stored.
Basically when you sleep only RAM works and no ROM storage is active, when you wake up ROM comes online, if you don’t pull data from RAM fast, it will be overwritten by other things and you lose it forever.
Dreams don’t really make any sense. When you wake up, you’re remembering the emotions and linking them with images, but as the feelings fade, unless you were actively making them into a narrative, the random stimulus soup doesn’t have any staying power worth remembering. Trying to remember just corrupts your working memory and will make you change and add details that weren’t there. Same reason eye witness testimony is very often wrong.