This is the result of the law of attraction or universal magnetization, which operates in accordance with psychological affinities, i.e. ego, desire, defects, etc.
For thirty years I sought God. But when I looked carefully I found that in reality God was the seeker and I the sought. -Bayazid al-Bastami