Marx adapted the dialectic of Hegel to develop dialectical materialism. He saw how the struggle of thesis and antithesis and its resulting synthesis always took place in the material and economic terrain. The central contribution of historical materialism is that history shows progress, not in a linear but cumulative, and that the cause of that progress is the struggle for the possession and control of the means of production. The ideas and political institutions would be the result of material production and conditions of distribution and consumption. For Marx, the continuous battle between opposing within modes of production forces inevitably leads to revolutionary changes, and eventually to communism, which would be the final recreation of a literally pre-historico State. Both Hegel and Marx are teleologic in his conception of history: both believe that history is progressive and addressed to a particular purpose.
The history of the means of production, therefore, is the structure of the story, and anything else, including the ideological discussion about the story itself, constitutes the superstructure. A classic example of history is written by the victors is the information that has come down to us from the Carthaginians. Roman historians attributed its secular enemies cruelties without story, including human sacrifices, that we can not compare with another version of the story. Similarly, we only have the Christian version of how Christianity became the dominant religion in Europe, but not the pagan version. We have the European version of the conquest of America, but not that of natives. Herodotus tells the Greek version of the Persian wars, but has not come down to us the Persian. A possible counter-example is the civil war, which the losers ridgeline have posted more information than the victors, to dominate the national perception of history (Confederate General Lee and Jackson are taken by superior to their adversaries, and movies like what the wind or the birth of a nation have fixed visual and sentimentally the point of view of the South in the collective imagination).