The human body as a machine is actually quite a lot more complex than any current human invention. We're not even close to fully understanding everything. So, the analogy to space flight serves to show that it's as naive to imply there's no subtlety beyond "it doesn't matter what you eat, just the calorie count" as it would be to imply "it doesn't matter what rocket fuel you use".
> People had stable weight without any special knowledge for most of human history.
A lot of food products highly available today would be rather foreign to most of human history: artificially high sugar, high cab, low fat, snacks everywhere, etc.
These trick our taste and hunger systems into eating more of less quality foods than we would "naturally" if exposed only to less "engineered" foods, like pure meat and vegetables.
> It's something we generally should know how to do automatically.
Maybe we should, but clearly we do not. At least with modern processed foods that are optimized and designed to maximally stimulate our flavor response while compromising nutrition/health (generally).