Our waking consciousness is only a part of our whole mind, which has two other planes, the subconscious and the superconscious. In dream functions the subconscious mind, when our past impressions come up and appear like real things; the superconscious state is known by the yogis.
Whatever we think or do is not lost; though apparently non-existent, it remains in the subconscious mind and then wakes up in the conscious plane. After repeated conscious acts we acquire a tendency. Each habit is a resultant of one class of impressions: suppose we read fiction or go to a certain place or talk or play every day, after a few days it becomes a habit, sometimes so strong that we find great difficulty in shaking it off. This resultant of past impressions has been given various names in Hindu scriptures as daiva (supernatural), adrishta (unseen) or niyati (destiny).
When people find it beyond their power to check the course of habit, when they see it impossible to get mastery over their lower nature, when circumstances press hard on them from all sides, they say, ‘How powerful is destiny, how irresistible is fate!’ The average educated man, unable to ascertain the cause of an event, is prone to ascribe it to the working of a supernatural being. What wonder that the uneducated, bred and nurtured in ignorance and superstition, finding no clue to the source determining the course of their thought and action, would attribute it to a deity endowed with supernatural power? And men are not wanting who invent stories to corroborate popular beliefs and fan the embers of superstition into a blazing fire. The priest in every country and in every age is the master-builder of superstition. These keepers of the people’s religion are ever ready to pour into the ears of their wards that they are quite at the mercy of the supernatural, and if it is pleased everything will go right. Led by their plausible and tempting words people try to appease the unseen powers with supplications and offerings and support and bribe the priests for welfare.
Source - 'Destiny and Self-exertion' by Swami Prakashananda in October 1904 version of Prabuddha Bharata.