If it was beyond us, and the event still happens, its cause must be beyond us. It is a short step to supernatural agency. As events became more complex, the explanations required much study and training. Religion, as a discipline, became the systemic attempt to provide explanations for the way the world works. The academic pigeonholing of religion and science is a very recent event.
Religion is a science in a sense, as it is a speculative enterprise.
It has rules, procedures, methodologies. They have changed in form but the structure remains. Most of the finest scientists of history have been adherents of one religion or another, for most sensed intuitively that science is fallible because scientists are fallible, and further that science has limits. So I would argue does religion. The complexity of both religion and science makes it impossible to master both.