K. Marx and F. Engels divided social relations into two types - primary material (basic relations) and secondary, ideological, superstructure relations. They regarded religion as a superstructure phenomenon. Religion does not have "its own essence not from this world", its own history, "special content." It represents a spiritual education, the result of social reflection, a specific form of social consciousness and a social institution. With such an attitude, the explanation of the nature and essence of religion meant for K. Marx and F. Engels the disclosure of the process in which social individuals, in the course of material activity and social ties, develop such definitions and characteristics that are reflected in public consciousness and become it (public consciousness) definitions and characteristics.
According to Marx and Engels, religion as a social phenomenon has a historical nature, which means the idea of it as a product of transient social conditions, and not some kind of eternal phenomenon. Religion is generated by such social phenomena that are characterized by a significant limitation of human life and activity, their dependence on the elemental forces of nature and society. In other words, religion is the result and form of a person's reflection of such a society that has not yet found itself, a society where perverse forms of organization of social life dominate.
The reason for the emergence of religion is the search for an answer to the situation of man's lack of freedom and the need to overcome the forces dominating him. Under certain socio-economic and political conditions, this need cannot be satisfied in a real way, through material and practical changes in the world. The way out for a person from this situation is this type of spiritual activity, as a result of the functioning of which a special world of ideal transformed forms is created, a world of fantasized creatures, properties, connections and relationships, with whose help a person expects to satisfy his needs.
Automatically recognizing the historical nature of religion also meant recognizing its temporary, transitory nature. Religion as a manifestation of man's lack of freedom has historically outlived its usefulness to the extent that man's freedom and independence develop. According to Marx and Engels, it is possible to create such social relations when a person passes from the "kingdom of necessity" to the "kingdom of freedom." German philosophers called this type of social relations communist. The establishment of communist relations, in their opinion, means the natural withering away of religion.
Among the philosophical trends of the twentieth century, studying religion, empiricism (J. Moore, B. Russell) and pragmatism (W. James) should be indicated. British empiricism was most vividly expressed in logical positivism (asserting that only scientific knowledge has cognitive value, and rejecting traditional metaphysics) and the philosophy of linguistic analysis that grows out of it. On this basis, an interest arose in the analytical study of religious language.