We are all one constantly moving body of energy. Positive energy attracts positive energy. What is good is positive and will be broadcast to all positive receptors. This is how prayer works.
We experience these situations all the time. When we are thinking of someone we love, they think of us. They may even call. Many times we say, “I was just thinking of you.”