As he moved on the earth, he came across or experienced floods and forest fire which made him realize the presence of some spirit behind all such things and happenings. He began to feel and realize and associate his own life and fate in the hands of some invisible power that perhaps he gave the name of God.
The fact that the name of God in different vernaculars, languages and dialects exists almost; all over the world in all religions, among all races and countries, means that either all mankind was thinking alike at one or the other time or the people in different regions or areas of the world were having some communication system even unconsciously, may be in the form of conveying of some fact, information, secret or piece of knowledge from person to person through the mouth, as the writing process, as we know now, came much later, indeed, recently only.
Whatever might be the origin of science and religion, the main point is their area of activity and their method of working. Science makes a man rational and free-minded. Religion wants man to believe blindly in what he is told to be true and worthy of being practiced. Science asks questions and puts every thesis or proposal to test. Religion abhors such methods.
Science believes in logical experiments and wants to declare something truthful and true if it comes out finally resultant of the experiment. Religion pre-supposes the result and wants to stick to it irrespective of the outcome of investigation, inquiry or experiment.
So, religion and science both are complementary to each other. For mankind, both are required in equal measure and simultaneously. Thus intrinsically, both are essential for man.