I recall a similar question being asked late last year, and it led me to discover the fascinating "Diary of a Napoleonic Foot Soldier."
It said that the soldiers in Napoleon's army were expected to purchase their own provisions from local merchants. This practice worked well in Western and Central Europe, but once the march on Moscow entered Eastern Poland, the massive armies found less and less to eat.
During the hot summer march, the soldiers stole and pillaged whatever food supplies they could find from local villages, although they often went days without water or food. The book describes how Moscow had an abundant supply of food, and many of the soldiers knew that starvation was coming once they left the city during the onset of winter.
During the winter retreat from Russia, the soldiers ate anything they could find, which often meant resorting to eating their horses. The book's author, Jakob Walter, survived on oats, fat, cabbage, dead horse and hog meat, and literally anything that was edible, in order to survive.
I'm not an expert on the subject, but the book gives a very detailed first hand account of the life of an ordinary conscript during Napoleonic times. I strongly recommend it.
Safe food meant strong troops and power to Napoleon, who noted aptly that “an army travels on its stomach.” His troops suffered more from hunger and scurvy than combat. In 1795, to be sure his men had safe rations, the French government under Napoleon offered a 12,000-franc prize to anyone who could come up with a food preservation method.
Nicolas Appert, the Parisian confectioner and distiller who ultimately claimed the prize, spent more than a decade discovering that boiled foods placed in airtight glass containers would not spoil. In 1810, Peter Durand, a British merchant who received the patent for the tin containers that were forerunners of the cans used today, further refined the concept, although controversy remains about that part of canning history, according to an article in the Institute of Food Technologies’ May 2007 issue of Food Technology.
Napoleon, as an artillery officer, was well versed in the importance of logistics in keeping an Army in the fight. On top of encouraging the development of canning, he also kept his armies from advancing faster than supply caravans could support.
/u/Teenage_Handmodel is correct. Generally the French advantage was in foraging, where they would buy, hunt, or scavenge for food on campaign in order to keep logistics simple. While this sounds very simple, it was a very different thing.
Between 1648 till 1792, war was a scientific endeavor where bloodshed could be minimized and civilian pain kept at a minimal amount. Thus food was kept in supply wagons as an army marched. While foraging was one topic brought up during the interwar years (1763 to 1789), it wasn't until the Republic was engaging in multiple and costly wars that foraging was brought back.
To recommend a good secondary source on the subject, you should take a look at Supplying War by Martin van Creveld.
In 1795 the French military offered a cash prize of 12,000 francs for a new method to preserve food. Nicolas Appert suggested canning, and the process was first proven in 1806 in tests conducted by the French navy. Appert was awarded the prize in 1810 by Count Montelivert, a French minister of the interior. The packaging prevents microorganisms from entering and proliferating inside.
This massive advancement in food preservation took place during Napoleons reign.
My 2 cents..
The developing feeling of Nationalism during and after the French Revolution meant that french soldiers could be sent out to forage for food with less change of desertion.
Without this, Napoleons giant armies would have needed much larger supply lines which would have slowed down his army. When fighting against a coalition as France had to do, mobility and the ability to switch fronts to fight against many armies is a necessity.
I also believe that he had a scorched earth "take everything you can find" policy during his Russian campaign. When Napoleon was forced to return through the same route that he had invaded, his army couldn't forage for adequate food because they had destroyed the land.