As a sophomore in college I struggled with third year French. I couldn’t get it conversationally. I could read it and the prof had me read a history of France in French because history at least used to be written in a fairly consistent and simple tense. The prof said I should go to France and that he could get me a Fulbright to study in Grenoble, a university well known for its history department. I was so frightened of the prospect of going so far from everything I knew (in Iowa!) that I turned away from it.
This was one of those turning points in my life that could have led to an alternative reality today. If I could have seen into the history of revolutions (mostly French) that attracted me then, I could have gone to Grenoble and made a career in French history. Instead I went on to study Russian and spend two years studying the Russian revolution. (Later I traded it all for study of Church history.) What I didn’t see was that the Russian was built on the four French revolutions (1789, 1830-1832, 1848, 1871).

Les Miserables is an impossible fiction about real events that speaks to the need for social change without violence leading to totalitarianism.
Hugo said:
“So long as there shall exist, by reason of law and custom, a social condemnation, which, in the face of civilization, artificially creates hells on earth, and complicates a destiny that is divine with human fatality; so long as the three problems of the age—the degradation of man by poverty, the ruin of women by starvation, and the dwarfing of childhood by physical and spiritual night—are not solved; so long as, in certain regions, social asphyxia shall be possible; in other words, and from a yet more extended point of view, so long as ignorance and misery remain on earth, books like this cannot be useless.”
Let’s be blunt. Hugo saw terrible injustice, inequlaity, and suffering around him all his life. The entire century and more was about the dismantling of divine right monarchies and the price paid by working people for industrialization. In 1832 he dodged bullets in the brief uprising, in 1848 he opposed the revolt and helped dismantle barricades. But he became a strong Republican and by 1871 he was able to support the Commune, if from a distance, with poetry. He spent 17 years writing Les Miserables to change the world.
Hugo explained his ambitions for the novel to his Italian publisher:

I think that the musical and film does great justice to the massive novel, which few will read. The score has wondrous riffs, hooks, and modulations. The lyric is superb. The final scene of the world – the 99% – at the barricade, always seeking justice and progress, freedom and egalite, gives us his purpose. Ultimately, Hugo’s answer to violence is personal love, always pushing progress to its next level in the next generation. The story, called the greatest novel, lifts liberalism from our own sewer of tea party shame. It will do so again for each new generation.