String together a bunch of random stuff, and eventually some of it will become true, or be able to be "interpreted".
Just probability.
Incidentally, there isn't really a separate conscious and subconscious... the terms are cognitive handles (and relics from long ago).
Stuff does happen "in the background" of your mind... such as the calculations necessary to catch a ball, or when things "pop" into the forefront, obviously something was going on...
But, regardless, the mind functions as a whole, and what's in the forefront of your attention isn't a separate faculty.
When you dream, it is because the input into forefront isn't coming from your senses, but rather from random electrical activity... or, rather "pseudorandom" as I call it, because it gets interpreted while you are dreaming as actually happening, which is why it "makes sense" at the time... perhaps the dreams you don't remember are the ones that are so random, they cannot even make sense in a dreamlike fashion.