One theory is that gods and goddesses are representations of forces of nature and by praying to them, you actually praying to the thing they you pray to her, you are actually praying to the moon. To the ancients, they probably thought that the goddess was an actual conscious entity but as science progressed, people had to rethink that.
Higher State Theory
Another theory is that the gods and goddesses are conscious entities that exist on a different plane of existence such as the spirit world or the astral plane. Personally, this is what I believe because it is supported by both ancient religions and quantum physics. In almost all mythologies and religions, the god(s) live in a different place than humans whether it be heaven, hell, Ásgarðr (Norse), Celestial Dilmun (Mesopotamian), or the astral plane. The existence of separate dimensions has been proven multiple times since 1900; one of the most recent scientific discoveries proving the existence of different dimensions is one made by UC Santa Barbara's Andrew Cleland who discovered that an object that exists on this plane of existence may exist in multiple other planes of existence. Numerous other discoveries proving the existence of seperate dimensions are made everyday at CERN, the worlds leading scientific research organization situated in Geneva Switzerland. This theory also makes sense of how things manifest from other dimensions to ours because, as Andrew Cleland states, things can exist on multiple dimensions, this items that you pray for can manifest from other dimensions to ours.
Another theory is that there are no goddesses and that the power that they give us was always within us. Prayer is merely a form of empowerment, raising our self esteem and acting as a mental placebo to make us think that we can achieve what we previously thought was unbelievable. Confucius once said "The will to win, the desire to succeed, the urge to reach your full potential... these are the keys that will unlock the door to personal excellence." Will to win, desire to succeed and the urge to reach your full potential are all things which are emphasized when one prays. Thus, when one prays, he/she focuses these things to mentally prepare them for the desired change. In this theory, there is nothing spiritual about prayer and thus, there is no need for the gods and goddesses to be actual deities at all. Personally, I do not believe this however, many people do, including many Wiccans Christians, Buddhists and other religious people.