Class struggle is the active expression of class conflict looked at from any kind of socialist perspective. Karl Marx and Friedrich Engels, leading ideologists of communism, wrote "The [written] history of all hitherto existing society is the history of class struggle".
Marx's notion of class has nothing to do with social class in the sociological sense of upper, middle and lower classes (which are often defined in terms of quantitative income or wealth). Instead, in an age of capitalism, Marx describes an economic class. Membership of a class is defined by one's relationship to the means of production, i.e., one's position in the social structure that characterizes capitalism. Marx talks mainly about two classes that include the vast majority of the population, the proletariat and the bourgeoisie. Other classes such as the petty bourgeoisie share characteristics of both of these main classes.
* Labour (the proletariat or workers) includes anyone who earns their livelihood by selling their labor power and being paid a wage or salary for their labor time. They have little choice but to work for capital, since they typically have no independent way to survive.
* Capital (the bourgeoisie or capitalists) includes anyone who gets their income not from labor as much as from the surplus value they appropriate from the workers who create wealth. The income of the capitalists, therefore, is based on their exploitation of the workers (proletariat).
What Marx points out is that members of each of the two main classes have interests in common. These class or collective interests are in conflict with those of the other class as a whole. This in turn leads to conflict between individual members of different classes.
An example of this would be a factory producing a commodity, such as the manufacture of widgets (a standard imaginary commodity in economics books). Some of the money received from selling widgets will be spent on things like raw materials and machinery (constant capital) in order to build more widgets. Similarly, some money – variable capital – is spent on labor power. The capitalist would not be in business if not for the surplus value, i.e., the money received from selling the widgets beyond that spent on constant and variable capital. The amount of this surplus value – profits, interest, and rent – depends on how much labor workers do for the wages or salaries they are paid.
This surplus value is higher to the extent that workers spend time at work beyond what they're paid for and to the extent that they exert effort beyond the cost of their labor-time. Thus the capitalist would like as much "free time" (unpaid labor during official lunch breaks, after official closing time, etc.) and as much worker effort as possible. On the other hand, the workers would like to be paid for every minute they work under the capitalist's authority and would like to avoid unnecessary and unpaid effort. They would also prefer higher wages and benefits (such as health insurance, defined-benefit pensions, etc.) and less of a dictatorial or paternalistic attitude from employers. Working conditions must be safe and healthy, rather than dangerous.
Not all class struggle is violent or necessarily radical (as with strikes and lockouts). Class antagonism may instead be expressed as low worker morale, minor sabotage and pilferage, and individual workers' abuse of petty authority and hoarding of information. It may also be expressed on a larger scale by support for socialist or populist parties. On the employers' side, the use of union-busting legal firms and the lobbying for anti-union laws are forms of class struggle.
Not all class struggle is a threat to capitalism, or even to the authority of an individual capitalist. A narrow struggle for higher wages by a small sector of the working-class (what is often called "economism") hardly threatens the status quo. In fact, by applying "craft union" tactics of excluding other workers from skilled trades, an economistic struggle may even weaken the working class as a whole by dividing it. Class struggle becomes more important in the historical process as it becomes more general, as industries are organized rather than crafts, as workers' class consciousness rises, and as they are organized as political parties. Marx referred to this as the progress of the proletariat from being a class "in itself" (a position in the social structure) to being one "for itself" (an active and conscious force that could change the world).
Marx thought that this conflict was central to the social structure of capitalism and could not be abolished without replacing the system itself. Further, he argued that the objective conditions under capitalism would likely develop in a way that encouraged a proletariat organized collectively for its own goals to develop: the accumulation of surplus value as more means of production by the capitalists would allow them to become more and more powerful, encouraging overt class conflict. If this is not counteracted by increasing political and economic organization by workers, it would inevitably cause an extreme polarization of the classes, encouraging the revolution that would destroy capitalism itself.
The revolution would lead to a socialist society in which the proletariat controlled the state, that is, "the dictatorship of the proletariat". The original meaning of this term was a workers' democracy, not a dictatorship in the modern sense of the word. For Marx, democracy under capitalism is a bourgeois dictatorship.
Even after a revolution, the two classes would struggle, but eventually the struggle would recede and the classes dissolve. As class boundaries broke down, the state apparatus would wither away. According to Marx, the main task of any state apparatus is to uphold the power of the ruling class; but without any classes there would be no need for a state. That would lead to the classless, stateless communist society.