The relationship between religion and science involves discussions that interconnect the study of the natural world, history, philosophy, and theology. Even though the ancient and medieval worlds did not have conceptions resembling the modern understandings of "science" or of "religion", certain elements of modern ideas on the subject recur throughout history. The pair-structured phrases "religion and science" and "science and religion" first emerged in the literature during the 19th century. This coincided with the refining of "science" (from the studies of "natural philosophy") and of "religion" as distinct concepts in the preceding few centuries—partly due to professionalization of the sciences, the Protestant Reformation, colonization, and globalization. Since then the relationship between science and religion has been characterized in terms of "conflict", "harmony", "complexity", and "mutual independence", among others.
Both science and religion are complex social and cultural endeavors that may vary across cultures and change over time. Most scientific and technical innovations prior to the scientific revolution were achieved by societies organized by religious traditions. Ancient pagan, Islamic, and Christian scholars pioneered individual elements of the scientific method. Roger Bacon, often credited with formalizing the scientific method, was a Franciscan friar and medieval Christians who studied nature emphasized natural explanations. Confucian thought, whether religious or non-religious in nature, has held different views of science over time. Many 21st-century Buddhists view science as complementary to their beliefs, although the philosophical integrity of such Buddhist modernism has been challenged. While the classification of the material world by the ancient Indians and Greeks into air, earth, fire, and water was more metaphysical, and figures like Anaxagoras questioned certain popular views of Greek divinities, medieval Middle Eastern scholars empirically classified materials.