People in primitive society consciously or unconsciously realize that there is no real thing in the world to sit still and enjoy the fruits of other people's labor  In order to survive, we must take up the weapon to transform nature, which objectively belongs to getting rid of the gods, but it is extremely difficult to transform nature, and some success depends to a large extent on accidental opportunities
Under such circumstances, on the one hand, the ancients won certain victories by their own strength, on the other hand, they attributed the victory to the gods
People's worship of gods in primitive society is due to the poor living environment.