> 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).
Really the problem goes in the other direction: now we have food from the "space age", and labour-saving automation, we can accidentally eat far more calories than we need.