How can we explain changes in foreign policy behavior? On what level can we locate the sources of foreign policy? Domestic or international?

Is foreign policy "a phase of domestic policy"? Do foreign policy strategies reflect domestic preferences? Is 'national interest' determined by the constellation of preferences of domestic actors?

Or, are foreign policy strategies moulded by the international system within which each state is located? The anarchic nature of the system and the comparative capabilities of a state within this system determine the "menu" of policies available to states.

Kenneth Waltz (1959) detangles these into different levels of analysis; second image and third image. Second image implies that we must look at the internal attributes and internal structure of states in order to then understand why a given state displays a given foreign policy behavior. Third image approaches are premised upon the constraining and limiting power of the anarchic international system.

The third image approach makes up the "neo-realist" or "structural realist" school of thought. Dynamics of change are of concern to neorealists insofar as their structural determinants can be theoretically grasped. Structuralist approaches aim to construct objective relations, divorced of essentialist arguments by breaking with individualist perspectives on social subjectivity (of leaders, decision-makers etc).

Within this all-encompassing anarchic "structure", all states have different capabilities (economic, military, technological). Capabilities are taken as relative to others. Therefore, foreign policy motivations must be aimed at relative gains.

Neorealism is a statist/state-centric approach. It offers a "state-as-actor" model of the world. One must view the state as an entity capable of having certain objectives or interests and of deciding among and deploying alternative means in their service (Ashley 1984: 238). State must be treated as an unproblematic and coherent unit with sharp boundaries. The interaction between them is characterized by competition to fulfill a given national interest.

Building on these ideas, political strategy becomes pure technique; the efficient achievement of goals that are set before the rational+self-interested political actor (state). 'International relations' occurs amongst technical-rational unities that interact. The system, or system changes, acts as a perpetual "mechanism" that englobes these interactions. In view of their limited capacities (capabilities) and the opportunities that the system throws at them, states follow whatever foreign policy strategies that they rationally can.

I'm still learning about theories of foreign policy, so I'm sure I have many mistakes above. I will be grateful for corrections. But my question is; when we are trying to look at State X's foreign policy post-Cold War as a case study (for instance), where do we stand to get a better view of its motivations? Inside in the domestic realm, or outside in the international realm? Is it justifiable to claim that neo-realism is an overarching theory and suffices in explaining foreign policy behavior, with no reference to domestic factors (e.g. public opinion, ideologies, NGOs, interest groups)?