It might not come to you as a surprise but this was first set up in 1789 after the Revolution by the parliament created by revolutionists.
There are 101 departements in France grouped inside 18 regions in France and abroad. Funny enough, they pretty much have kept the same name since the revolution apart from a few like Charente Maritime which was called “charente inferieure” (as it was a bit lower geographically) but people living there did not like being called inferior to the Charente people!! Not that we , yes I am a Charente person, like to remind them of that at all!!!
There are 18 regions since 2016, 27 before. The French governement trying to save money have made them bigger. 13 of them are in France (and Corsica). The others are Mayote, La Reunion (indian ocean), Guyane (South America) and Martinique, Guadeloupe (Caribean).
The role of the departement is wide but mainly, it is in charge of : roads (D roads), internet access, security against fire, education (in charge of colleges -school for year 11 to 15), libraries, sport centers, retirment home, handicap, social care and environment.
People/Politicians representing us in the Conseil Departementale and in charge of all those jobs are elected for 6 years. 2 conseillers (one woman and one man to stop men taking over the world again) are elected per “Canton” (mini regions inside each Departements)
The role of the region is about the same but instead of college, it is Lycee (school for 15 to 18 years old), bigger roads (N roads), It is also in charge of economical development, European programs, Patrimoine, Environement and transport.
People/politicians representing us in the “conseil regionale” (mini parliament made of 183 people for Nouvelle Aquitaine region) are elected for 6 years. If your department has more than 100 000 inhabitants, you have 4 representatives, if lower, only 2 (one woman and one man).
Note that New Caledonia, French Polynesia, St Pierre et Miquelon, St Martin, St Barthelemy, Wallis et Futuna are Territoire d’Outre Mer so not entirely part of France and they have each their own law agreed with France. For instance, only St Martin is part of the European Union. French laws do apply on those territories and if you have the chance to go on holiday in Tahiti, you could get stopped by Gendarmes! And they do vote for the French President. But they also have their own President!! Some have their own money.