How do the different parts of the substructure and superstructure determine each other according to Marx?
Marx is usually understood as arguing that the substructure (the material world) determines the superstructure. But that’s only part of his argument. The creation and propagation of ideology is an important activity of the ruling class. The members of this class usually do not work but appropriate the fruits of the labor of other classes, and hence they have the necessary leisure time to engage in intellectual “work” and to construct and promote ideologies that they can use to serve their interests, consciously or unconsciously. Those with material power also have intellectual power. They can influence what others think, and they will be most successful if they themselves believe the ideologies that they want to force on others.
This clearly shows that the substructure does not only determine the legal and political parts of the superstructure, but thinking as well. The prevailing ideas are the ideas of the prevailing class.
[T]he class which is the ruling material force of society, is at the same time its ruling intellectual force. The class which has the means of material production at its disposal, has control at the same time over the means of mental production, so that thereby, generally speaking, the ideas of those who lack the means of mental production are subject to it. The ruling ideas are nothing more than the ideal expression of the dominant material relationships, the dominant material relationships grasped as ideas; hence of the relationships which make the one class the ruling one, therefore, the ideas of its dominance. The individuals composing the ruling class possess among other things consciousness, and therefore think. Insofar, therefore, as they rule as a class and determine the extent and compass of an epoch, it is self-evident that they do this in its whole range, hence among other things rule also as thinkers, as producers of ideas, and regulate the production and distribution of the ideas of their age: thus their ideas are the ruling ideas of the epoch. K. Marx, The German Ideology
But there is a kind of feedback action at work here. The substructure determines ideas, but these ideas in turn help to maintain a particular economic substructure. Not everything goes up from the material to the intellectual. Something comes down as well, but only after it went up first.
This can be expressed in the left half of the following drawing:
In this drawing, an arrow means “determination”. All ideas, not only political and legal ones, are both the expression (arrow 2) and the safeguard (arrow 3) of the economic structure of society. (The bottom-left half, arrow 1, represents the previously mentioned relationship between means of production and relations of production).
But there is also a right half in this drawing: the fact that ideas, in a kind of feedback mode, help to determine a particular economic structure, does not always have to be negative or aimed at the status quo. The poor, when they shed their false consciousness imposed by ideology, become conscious of their real situation, and this consciousness will help to start the revolution which will modify class relations and hence the substructure. This is represented by arrow 6.
Ideally, arrow 6 would have to pass through the box containing “politics” since the revolutionary proletariat will take over the state when attempting to modify the relations of production.
However, this awakening is bound to certain material preconditions, in particular the presence of certain very specific forces of production, namely large-scale industrial production with mass labor (arrow 4) and the strain imposed by existing class relations (arrow 5). It cannot, therefore, take place in every setting. Ultimately, all consciousness, real and false, is determined by the substructure. The order of determinations is fixed and follows the numerical order in the drawing.
More about Marx here.