This is an attempt to locate the idea of socialism and the socialist and working-class movements in history. This will here be done by relating the trajectory of socialism to capitalism, as a rival, and by highlighting the main social forces carrying the idea of socialism in the 20th century. These forces were two grand social dialectics, that of industrial capitalism and its generating working-class growth and strength; and, little studied, the dialectic of capitalist colonialism which needed and created a subordinated colonial intelligentsia, which came to organize and lead anti-colonial movements to independence, very often under a banner of socialism. Both dialectics have now largely expired. The victories of socialism were nowhere constructions of fully postcapitalist societies but vehicles of precapitalist development. Here achivements were considerable, as were socialist reforms within capitalist societies. However, catching up with its older and richer brother caitalism turned out an ever elusive goal of socialism, and the socialist horizon faded. A new postcapitalist vision is emerging with the climate crisis.