Karl Marx believed that history unfolded in distinct phases, the last of which would see the overthrow of capitalism by the world's working classes. After this revolution, history would enter a Utopian phase of economic, social and political equality.
Living in the 19th century, Marx witnessed some of the worst excesses of industrialization and urbanization, along with the effects they had on working people. Consequently, he concluded that capitalism was an exploitative system that would eventually be overturned by the people it oppressed. Looking backward, Marx built an interpretive model of social development in which the sole motive force of that development itself was economic security and gain, the fight for resources and adaptation to material conditions, a concept called "historical materialism."
Marx then built upon the idea of historical materialism in identifying a continual pattern throughout history that he called a "dialectic" (after Hegel), in which ruler-ruling class systems succumbed to new ones in perceivable cycles. The first cycle ended when Greek and Roman antiquity, with its slave-ruled class, gave way to the medieval feudal system, where lords ruled over serfs. That model was then replaced beginning with the French Revolution, when absolutist monarchy was replaced by the Bourgeoisie or capitalist class.
In Marx's final phase, the victory of the working class over the Bourgeoisie would usher in a new time when all resources were owned by the state, or the people as a collective, rather than by a single ruling class given some abstract social entitlement to the majority of the wealth. As such, wealth would then be evenly distributed, limiting the workload on any one demographic, thus allowing all to pursue those things which enriched or edified them. For Marx, those pursuits would naturally be intellectual ones, given such pursuits were long denied working class people on account of their menial labor in the factories, mills, rail-yards, etc.