Just a bit of history of french politics since WW2:

After 1945, the IV Republique is created, it's a parliamentarian regime, with a strong left side. Long story short, the decolonization in Algeria is a mess, the socialist government sends conscripts (which was seen as a betrayal at the time), there are rumors of military coups, and, in 1958, Charles De Gaulle steps in.

De Gaulle and his political allies create a new Republic, the V (the current one), with a really strong president/government. This constitution was pretty much tailor-made for De Gaulle, and, now days, it raises some issues:

* Some dangerous articles, like Article 16, where the president can basically be a dictator for 30 days if the Nation is in danger.

* All executive and most of the legislative power concentrated in the hand of the President/Government, the parliament can be bypassed using the Article 49.3.

* Lack of political diversity, with the major parties over-represented (ex: the FN, ~20% of voters, only 2 of the 577 members of parliament).

Back to history, from 1958 to 1974, De Gaulle/Pompidou, not a lot of opposition (except May 68 events, but it didn't translate into political changes, at least immediately).

From 1974 to 2002, it's a classic right/left opposition with two main parties, and a few smaller ones which were absorbed or lost influence over this period:

* The Socialist Party (PS).

* The conservative Party (RPR, then UMP, then LR, it renames itself a few times).

* The main smaller parties were UDF (Liberal Right) and the PCF (communist party).

The Jean-Marie Le Pen's Front National (FN) also grew in that period, from less than 1% of voters in 1974 to 15% of voters.

The timeline is:

* 1974 -> 1981: Giscard D'Estaing (Liberal Right, somewhat comparable to Macron actually).

* 1981 -> 1995: Mitterand (Socialist, with a shift to Social Liberalism in ~1983).

* 1995 -> 2002: Chirac (Conservative Right).

With "Cohabitations" during Mitterand and Chirac terms (if the parliament has a majority belonging to the opposite side of the President, the President is forced to have a prime minister from this side, the prime minister is the de-facto new head of state in that situation).

Then came the 2002 election, lot of fragmentation of votes between candidates from the left resulting in Jean-Marie Le Pen being present at the second turn of the election against Jacques Chirac (RPR/UMP). At the time, this was seen as an accident, and Chirac was elected with 82% of votes (with Socialist votes), Jean-Marie Le Pen gaining no votes between the two turns (side note: Jean-Marie Le Pen is Marine Le Pen's father).

In 2007, Sarkozy (UMP) is elected, using some Front National and Jean-Marie Le Pen ideas in his program (National Identity, anti-immigration stance), resulting in the FN losing 1/3 of its votes from 2002.
His presidency is littered with political scandals: small stuff like injures ("Casse-toi pov' con"), not so subtle ways to celebrate his election (Diner at the Fouquet's, holidays spent on billionaire Bollore's yatch), and a lot of political affairs and meddling with the judiciary system (Affaire Bettancourt, Gaddafi financing his 2007 campaign, affaire Paul Bismuth, affaire Tapie and affaire Bygmalion (for his 2012 failed reelection)).

In 2012, people are tired of Sarkozy, and the 2008 crisis/Euro crisis is a big concern. Francois Hollande is elected with a seemingly strong stance against the Finance world ("Mon ennemie, c'est la finance"), and a lot of promises for better regulations of banks and financial institutions.
In practice he didn't put his promises in action, and lead liberal policies (tax exemption for companies (CICE), lower social protection (loi El Khomri, loi Macron), he even uses some FN ideas like "forfeiture of nationality", his party was divided between its left and its right wing, and there were some scandals again (affaire Cahuzac). His policies didn't succeed in improving the economy and the general feeling from his electors was betrayal.

At the same time, the Right party (UMP/LR) was in turmoil, consequence of the various Sarkozy's scandals and internal competition for leadership.

Then came this 2017 election, which is a shift from the previous schemes.

The two main parties were deeply weaken:

* The LR (Right) chose Fillon as its candidate, with a "tatcherian" program and supported by a catholic movement ("Sens Commun", created during the anti-gay marriage demonstrations). The party was weaken by its internal conflicts between 2012 and 2016, and Fillon lost some voters because of "Penelopegate" (He paid his wife as his assistant for years with public money, without her producing any work).

* The PS (Left) chose Hamon, with a strong socialist program. But the party was divided, lots of its figures defected to Macron, and even those remaining didn't support Hamon a lot to say the least. Hamon also had the baggage of Holland presidency to deal with. And his social program was really close to Jean Luc Melenchon programs (actually it is said that Hamon basically stole Melenchon program, with a few differences regarding the EU).

At the same time, new political forces rose:

* The FN with Marine Le Pen tried to soften its image a little (Banning of outrageously racist or anti-semitic public comments, resulting in the exclusion of Marine Le Pen's Father, Jean-Marie Le Pen), but with still the same people, including some borderline neo-fascists (GUD connection), and the same ideas. The FN gained voters in local and European elections between 2012 and 2017 as a result (with the help of the general turmoil of the two main parties)

* Emmanuel Macron, former public finance inspector, former banker at Rothschild, former Francois Hollande counselor, former finance minister. He left the government around one year ago to prepare for the election, dissociating himself from Hollande and the PS. He is well connected, some liberal thinktanks gave him a few millions, he has connection with industry/finance/media owners like for example Xavier Niel or Pierre Berger (owners of the "Le Monde" paper) and a some right wing PS politicians defected from Hamon to him (former prime minister Valls for example). He managed to gain voters from the right wing of the PS, and some of Fillon's voters (because of Fillon's scandals, and links to Catholic movement "Sens Commun" (anti-gay marriage movement)). He is not that well received by many voters, and it is said that only 10% voted for him truly by conviction.

* Jean-Luc Melenchon, former PS member who defected in 2005 (after the EU constitutional referendum). He created a movement (Front de Gauche in 2012, France Insoumise in 2017) based on alliances with smaller parties at the left of the PS (specially a complicated and shaky one with the PCF, the french communist party). Melenchon was candidate in the 2012 election to, gathering ~12% of voters. In the 2017 election, he lead a very good campaign with a strong socialist program and an interesting usage of social media (a lot of interaction with his followers, various videos and streaming on youtube, lot of work done to demonstrate the feasibility of his program, his campaign even spawned some amusing stuff like the Fiscal Kombat game). He managed to gain many voters from the left wing of the PS as a result.

In the end, the PS completely collapsed, Hamon gathering only 6% of voters, and there were 4 candidates bewteen 20% and 24% after the first turn, with Emmanuel Macron and Marine Le Pen being the two first and qualified for the second turn.

Interesting to note that there is strong geographical disparities between Macron and Le Pen, Le Pen being strong in North, East and South East of France (mostly rural areas and former industrial regions with closed coal mines, textile factories, and steel mills), Macron being strong in big cities (Paris, Lyon, Nantes, Rennes) and western half of France.

The second turn gave Macron a significant advantage (66% Vs 34%), but some elements undermine his victory:

* Marine Le Pen manages to gain some votes between the two turns (unlike her father in 2002), thanks to greater porosity between LR and FN ideas and an alliance with Souverainist party "Debout la France" (~5% of voters in the first turn).

* at 34%, the FN is still really high.

* Many voters voted "against" Le Pen and her ideas, and not "for" Macron

* Abstention rate for the second turn was one of the highest of the V Republique, and there was 8% blank votes which is unprecedented, people are tired to vote against their political opinions to avoid Le Pen election.

The coming legislative election will be an interesting test, and will sort out many of the unknowns:

* Is the relative collapse of LR was due only to Fillon's scandals or is it more general?

* Will the PS survive at all after gathering only 6% of voters?

* How many members of parliament the FN will win?

* Will new movements like France Insoumise (Melenchon) and En Marche (Macron) be able to elect large groups?

* If no clear majority emerges for En Marche (Macron), which alliances will be constituted?