It's a mix of imagination and perception. When the first signs of definite religion appear in cave paintings and carvings, those people were exactly as evolved as we are today. Just as intelligent and capable of processing the same levels of information.
Take away traffic, cities, and pretty much every human you know except for a dozen, maybe a few dozen for a large band.
All those distractions gone. Now you have all that brain power to apply to your surroundings. If you're observant and good at investigation, you could glean quite a lot of information.
Imagination doesn't work in a vacuum. It's a creative process, connecting seemingly unrelated pieces of information into a brand new realization. Imagination is the reason we took over the world. It didn't seem to exist in most hominids. The same power to imagine that a herd will come to a certain area in a certain season is the same one that can see that there is power beyond what we can see in the entire world around us.
Whether we call it God or Physics is really just stating a preference.