Yeah, it's mostly a matter of circumstances, otherwise he'd never have gotten as close to presidency as he is. Here's the rundown.
The basics: french people first choose between a bunch of candidates, then they vote again to decide between the two who scored highest.
First round major candidates were:
> Le Pen (neo-nazi in her ranks, has strong ties to Putin, advocates for frenxit)
> Fillon (conservative, got caught up in two scandals, one involving him being bribed and the other involving him stealing state money for his wife- he refused to go to court to face the charges)
> Mélenchon (frexit + some communist shit)
> Hamon (insignificant leftist person with Mélenchon's ideas, only softer)
> Last but not least our man Macron, whose strategy was to change his discourse depending on who he was talking to, to pretty much agree with everyone, and to make very abstract declarations such as "I will be the best job president ever".
Le Pen carries a very heavy past in France due to her father being supportive of Pétain, the dude who allied with nazi occupation during WWII, and most her party's members share her father's ideology, even though her position leans heavily towards liberal (gay rights, etc). She got the second highest score and will oppose Macron in the finals.
Fillon was fucked the moment he tried to deflect the scandals as "things that should not be the focus or the campaign" and refuse to go to court when summoned. He got third.
Mélenchon got fourth, which is a fucking high as hell score for a communist, even in the socialist land of France.
And Macron got first, because he was the least bad.
Also all other candidates except him had already been candidate for presidency at least once before (and were defeated). Macron was the only newcomer, from a generation younger than all the others, and since he has no real program, party, or political alignment, he seems refreshing and harmless.