Critical realism took its origin within the philosophy discipline, arising at the time that there was profound debate over the adequacy of logical positivism as a basis for the philosophy of science. Carl Hempel represented the fruition of positivist philosophy of science, with his hypothetico-deductive model of confirmation, his deductive-nomological model of explanation, and his covering-law model of historical explanation. These all amount to the same idea, of course: that scientific knowledge takes the form of a set of general theoretical principles or laws, a set of empirical statements about existing conditions, and a set of deductions from the laws and statements of consequences for the observable phenomena. There was a strong reaction in the 1960s to the orthodoxies of logical positivism and Hempelian philosophy of science by philosophers such as Norwood Hanson, Paul Feyerabend, and Thomas Kuhn. Compelling criticisms were offered of the strict distinction between observation and theory, concerns were raised about the putative coincidence of explanation and derivation from general laws, and more nuanced theories of scientific rationality than the hypothetico-deductive method were offered.
A particular sticking point within the positivist theory of science was its common adherence to a Humean theory of the meaning of causation as constant conjunction. Hume derided the idea of “causal necessity” and sought to replace this notion with the idea of conformance to a strong regularity. Rom Harré and Edward Madden undertook a strong critique of this assumption in Causal Powers: Theory of Natural Necessity, also in the mid-1960s. And this anti-positivist strand of thinking about causation was more important to the emergence of critical realism than any other influence.
Several gifted sociologists joined this debate in the 1990s. Especially astute were contributions by George Steinmetz and Margaret Somers, both colleagues at the University of Michigan, and Philip Gorski at Yale. In a review article in Society for Comparative Study of Society and History in 1998 Steinmetz provides a careful review of the intellectual background and the central ideas that Roy Bhaskar introduces in his writings on naturalism and realism (link). Steinmetz reviews the mainstream assumptions that defined positivist philosophy of social science through the 1960s and the echo of these assumptions in mainstream sociology; and he provides a fairly detailed description of Bhaskar’s alternative. He emphasizes several central ideas:
- the transcendental nature of Bhaskar’s reasoning: “discovering what must be true about the world for science to be possible” (176)
- the distinctions among the real, the actual, and the empirical
- the scientific importance of “open systems” — systems lacking causal closure and displaying contingency
- a specific idea about emergence — "Emergence is defined as the relationship between two levels such that one arises diachronically (or perhaps synchronically) out of the other but is capable of reacting back on the lower level and is causally irreducible to it (Bhaskar 1993:73) 
I will argue that most historical researchers, whatever their self-description, are critical realists rather than theoretical realists, positivists, or neo-Kantian idealists, and that this stance is the most defensible one for the social sciences in general on ontological and epistemological grounds. (171)Steinmetz believes that the philosophy of science articulated within critical realism accords very well with the practice of historically minded social scientists like himself. He closes his article with these words:
Critical realism is especially “liberating” for historical sociology. It provides a rebuttal to the positivist and theoretical realist insistence on the dogmas of empirical invariance, prediction, and parsimony (see Bhaskar 1989:184). Critical realism guards against any slide into empiricism by showing why theoretical mechanisms are central to all explanation. At the same time, critical realism suggests that contingent, conjunctural causality is the norm in open systems like society. Yet critical realism’s epistemological relativism allows it to accept the results of much of the recent history and sociology of science in a relaxed way without giving in to judgmental relativism. Historical social researchers are reassured of the acceptability of their scientific practice, even if it does not match what the mainstream misconstrues as science. Critical realism allows us to safely steer between the Scylla of constricting definitions of science and the Charybdis of solipsistic relativism. (184)The methodology that Steinmetz commends is one that highlights social contingency and conjuncture, while at the same time discovering explanatory relations among circumstances based on the causal mechanisms we can identify that connect them. These are all important aspects of sociological research, and we should indeed seek out philosophies of social science that make room for them.
That said, I am not persuaded by the unfavorable distinction that Steinmetz and Somers draw between scientific realism and Bhaskar-style critical realism. I am inclined to think that the tradition of scientific realism has less baggage (from logical positivism) and critical realism has more (from Bhaskar's sometimes arcane philosophical arguments and distinctions deriving from transcendental philosophy). Here is Steinmetz on the deficiencies of theoretical realism:
Theoretical realism disparages explanations which invoke unique, nonrepeatable constellations of causal mechanisms in accounting for specific historical conjunctures. (174)But this doesn't really seem to be an accurate portrayal of a wide range of scientific realists, including Richard Boyd. In fact, we can better look at the tradition of scientific realism as being closer to another tradition that Steinmetz admires, that of American pragmatism. (For a long time Harvard's department of philosophy was the home of scientific realism, and it was also the intellectual heir of James and Peirce.) Scientific realism, when considered as a meta-theory of the work of social sciences, simply extends to the social sciences the ontological elbow room that the natural sciences have long enjoyed: when we postulate unobservable entities, causes, and processes, we are sometimes justified in believing that these entities actually exist -- provided that our hypotheses are appropriately linked to observation and inference emanating from a dense field of scientific inquiry.
Take a sociological construct from Bourdieu that Steinmetz finds to be very useful, the idea of an intellectual field (link). This construct plainly invokes an extended and intangible social structure or entity -- an interconnected system of individuals, values, and institutions that steer the progress of persons and ideas through their careers. The concept has proven to be a plausible and contentful way of conceptualizing sociological phenomena across a broad range of contexts (intellectual and cultural history, imperialism, scientific research, political ideology), and Steinmetz and other sociologists are justified in attributing real existence to this construct. But this realist interpretation of the construct does not require esoteric philosophical reasoning; we can look at it as a very ordinary and pragmatist inference from the orderliness of a specific range of social phenomena to the best explanation -- that there is an underlying field of interrelations that generates this orderliness. And it seems to me that mainstream scientific realists like Boyd and Putnam would be very satisfied with this line of reasoning.
So I would look at these comments as a minor corrective to Steinmetz's argument here: social scientists are indeed well advised to be anti-positivist; they are well advised to be realist in their theorizing; but there is nothing in the case that suggests that Bhaskarian realism is the particular variant of realism they should assume. A more pragmatic and pluralistic version of scientific realism seems more suitable to research in sociology. (Here is a brief discussion of a more pluralistic and eclectic version of scientific realism for the social sciences; link.)