When we see maps of Europe of the late Medieval and the Renaissance era we usually see an assortment of smaller duchies, principalities and more rarely, some bigger state which encompasses many ethnicities and didn't really have a unified national identity. Then we see France, a comparatively massive blob of land, which had strong centralised rule (mostly) and where most people, apart from their local identity, saw themselves as culturally French. Why and how did France unite as a quasi nation-state so early?
I'd question your premises.
First, medieval France did not have a strong centralized rule. It was itself an assortment of smaller and larger duchies, etc. If you look at this map here, at the beginning of the Hundred Years War, the French crown had immediate authority over the dark pink areas. The blue were held by the Angevin kings of England, the gray by other nobles ( like the Duke of Brittany) Though they might owe fealty to the French King, his authority was limited, and there were always complex relations, and sometimes outright feuds, among kings and nobility. The Hundred Years' War did end up making the French king more powerful, and the country less fragmented...but not thoroughly.
Second, medieval France was smaller than modern France. If you look closely, for example, you'll notice that it stops at the west bank of the Rhône. Perpingan would think of itself as Catalan until 1659.
Third, no, they did not necessarily consider themselves culturally French and speak the same language. Much of the south spoke Occitan or Provençal dialects, even areas we don't think of as Provençe now, like Limoges and Correze. Brittany still spoke Breton ( at least three dialects) The north, still called French Flanders, spoke Dutch. What's now southern Belgium, Wallonia, had its own dialect, as did Normandy. Alsatians mostly spoke a German dialect. On the eve of the Revolution, villages only dozens of miles apart would be speaking different dialects, languages. And the extent of centralized control over them could be light. Even though Louis XIV could tax them ( sometimes heavily) and issue proclamations, he could not necessarily run them from Versailles.
The big push to create a French country and identity came with the end of the Old Regime and the 19th . c. Dialects were hunted down- students speaking their own Breton or Occitan in class were punished ( even into the 20th c.). The Revolution and Napoleon would begin to create the famously immense French bureaucracy that exists today.
Robb, Graham (2008) The Discovery of France