In the Star Trek universe, there is an episode in which the ship travels to primitive world (Mintaka III) and the crew accidentally reveal themselves to the humanoid people there who are similar to bronze-era humans. The Mintakins think the captain of the ship (Picard) is a God because he obviously has powers they cannot comprehend. He rejects their beliefs that he is a supreme being and in the most beautiful ending possible, they listen to logic and believe him. But the climax in the story hinges around whether or not Picard can prove to these people he is not a god before he and the crew have to leave, leaving the peoples' imaginations to run wild with what "God wants" from them. They almost murder someone, believing Picard is angry at them for something the person did.
The point of the story is to provide a scientifically feasible explanation for humanity's belief in gods as essentially aliens who visited long ago and were unable to prevent humans from letting their imaginations run wild with tales of what the gods do, how powerful they are, and what they want from the people on earth. Over the course of thousands of years, there is no limit to how our imaginations can bend such an experience, twisting it into the culture of the time of the visit and adjusting over time to fit more and more into the development and history of societies.
But it doesn't take a visit from aliens to start a religion. We have all seen things we can't explain. Schizophrenia exists. Con artists manipulate reality to steal from people. Psychedelics exist naturally. Once-in-a-generation storms cause mass destruction. There are so many possible explanations for gods other than omniscient, all-powerful beings.