Napoleon. The genuine remarks are broader and blunter. In Count de Las Cases’s Journal of the Private Life and Conversations of the Emperor Napoleon at Saint Helena (London: Henry Colburn), an entry dated July 1816 records Napoleon telling an idle boy named Tristan that no one should eat who does not work, then tapping the child’s belly: “Such is the influence of the belly … It is hunger that makes the world move.” The passage can be read in the Internet Archive’s scan of Volume II ↗. A later volume has him say of army rations, “There is no subordination with empty stomachs.” Both sit in the Attributed section of Wikiquote’s Napoleon page ↗. Neither is the saying.
Frederick. The 1762 London translation of Frederick’s Military Instructions opens its chapter on magazines and subsistence with a closely related maxim — and pointedly does not claim it: “It was said by a certain General, that in order to have a good army you must begin by providing well for the belly, which is the main spring of every operation.” (Spelling modernised from the printing’s long s; see the scanned volume ↗.) It is a different sentence from the one under investigation, and Frederick presents even this one as somebody else’s.