Its completely from mind. Your unconscious minds keeps on storing information that you gather knowingly or unknowingly. Trying to connect dots on the basis of dreams doesnt help. Because there is no pattern of how mind takes this info. Also It is important to note that there is infomation stored in genes which you got from your ancestors..
Mind is a mistery
In India many Sadhus and rishis or saints have conqured mind through Yoga Meditation. It takes great courage and disciple to do that. Buddha conquered mind and given Vipassana to the world which is a form of meditatioj technique to go beyond your senses and experience the bliss.
But yes for 99.99 % people mind will remain mystery because mystery can be solved when you turn inward rather than outward.