It probably started with royalty. Some smelly animal got a taste for pastries and cakes and threw all kinds of money at the venture. Set up trade to ensure a surplus of flower, sugar, and eggs. Enough for an infinite number of trials and errors.
Perhaps there was a preexisting surplus with added support from a wealthy class, including overseas traders and other Kings and Queens.
The French might also have a taste for perfection. Something in the water. In any case, the French have stumbled upon a magical craft. We should try to work pastries and cakes into our diets.