One of Marxism's distinctive ideas is its insistence that there is a causal relationship between material conditions (often called the base) and all kinds of non-material phenomenon like ideas, ideology, etc. (often called the superstructure). As always, interpretations vary, but one popular notion of this - what Lenin called "vulgar materialism" - supposes that this relationship is direct and absolutely deterministic, so that the superstructure is really just a superficial epiphenomenon of the material economy.
I'm pretty comfortable with arguing that this is a demonstrable misunderstanding of Marx. What he actually argues is that history passes through stages (feudalism, capitalism, socialism, etc.) and that each of these stages are conducive to the appearance and proliferation of some ideas, and adverse to others.
So to take a simple example, a feudal economy lends itself to the idea that some people are naturally superior to others. Powerful people in a feudal economy are going to tend to believe this idea, promote it and defend it for all kinds of obvious reasons -- and because they are powerful, they will probably succeed. It's not that the idea of equality is impossible under feudalism, or even inconsequential; just the opposite! Feudalism was wracked by occasional uprisings by people who thought they deserved better, and these uprisings had all kinds of significant immediate consequences.
Nevertheless, until feudalism actually ended, its ruling class and its institutions were always in a position to ensure that their ideas remained dominant. The end of feudalism and the emergence of capitalism, of course, was associated with another set of ideas, including the appearance of a primitive kind of egalitarianism. Did egalitarianism drive the emergence of the bourgeoisie, or did the emergence of the bourgeoisie drive egalitarianism? The answer, Marx would argue, is both: the process is dialectical.