Couple reasons :
- The Left has been unable or unwilling to take a serious look at racism and islamophobia, meaning that they progressively lost all kinds of votes that in theory would've been theirs. Obviously that comes from the fact that in a lot of cases the Left itself is as racist, xenophobic and/or paternalistic as the Right
- I think around the 70s or 80s (maybe earlier though) they progressively moved away from any sort of alternative model/idea for societies and totally adopted the capitalist model, meaning what they were working for was "softer" capitalism, not something different than capitalism itself. So there too they lost voters or at least the capacity to "inspire". Politics is still about selling
an idea, a program, an ideal vision of society. What's theirs?
- Overall extreme-right ideas have progressively been adopted by what is called the "traditional right", pushing the political axis more and more to the right. Overton window and all that. Having no compelling narrative to offer as a contradiction, the Left got left in the dust.
- The fall of the USSR and the horrors of "communism" were also a big blow to the Left (ironically Nazism was not for the Right, but I digress) at the international level, but the real deal breaker was having basically all the Central and Eastern countries go 10000% right-wing capitalism. The Left is virtually non-existent in a lot of those countries, so at the continental level the Left lost a lot of weight, which obviously has an impact at the national level. They also heavily leaned towards the US, meaning US ideas had a boulevard into Europe via them. There's been a clear shift towards the Right, towards english as a lingua franca and towards the EU as just an economic union as opposed to a political idea since the 2004 expansion.
- The Left, having adopted the capitalist model with no questions asked, has not been able to protect the little guy and workers, so a lot of them turned away, even more so that right/extreme-right rhetoric has been very efficient in accusing migrants of "stealing our jobs" (that sounds like some Coli brehs, but again I digress

) when anyone with basic understanding of how the economy works should know that the problem is not the guy next to you, but the guy above you.
- In France, the fact that the Left itself moved away from trade unions, adopted the capitalist ideal etc means that they lost their link to what was always the basis of left movement : the popular masses and workers. There's always been prominent and wealthy intellectuals on the Left, but you usually had the backing of a solid popular basis. That has been lost because given how the workforce has evolved it's harder to create a mass of workers with similar aspirations (used to be that you spent your whole career in one city and one company, now people are moving around and changing jobs much more often), robotization, etc. So leaders of the Left don't come out of the popular parts of society or from some worker's union, but from middle to upper class families who have the means to send their kids to good universities. No problem per se with that, but years and years of this has created a sort of disconnected intellectual image of the Left, which is called "La gauche caviar" in France ("Caviar Left") or the "bobos" ("bourgeois bohèmes", basically left-leaning "woke" hipsters).
- Overall the problem with the Left is that it's supposed to be forward-looking and offering new perspectives and progress. In an extremely quickly changing world, especially since the fall of the Wall, 9-11, the rise of social media, it's been very hard to have time to actually take time to think and reflect on what those perspectives should be, nevermind how to achieve them. Even more so that the Left has always had much less financial means than the Right, for obvious reasons. So the Left has mostly been "reacting" to what has been going on, as opposed to being proactive. In such a quickly changing era with a lot of uncertainties and fear, the Right will always do better because they cater to those fears by offering "solid" "values" : security, us vs them, family, blood and honor, nostalgia about a glorious past one has to get back to ("MAGA"), a house/family/nation/culture to "protect" against foreigners

, etc.
- Forgot to add : in general a presidential system like France's works in favor of the Right because there are usually less parties on the Right and again it's way easier to rally around ideas from the Right (all you really have to say is "We're better, they suck, money uber alles and foreigners are dangerous") than it is around ideas from the Left which tend to be a little more complex and with various layers. Which is why you usually have more parties on the Left than on the Right. In a parliamentary system where ALL parties who get votes have a say in who is in government the Left can still be represented, whereas in a presidential system as in France whoever isn't in the top 2 in votes basically loses any say in who will be president, and thus on who will be in the government. So ironically, France kind of de facto leads to a two-party system for the presidential election.